portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/sql/external coffees-oracle.sql populate-db2.sql populate-mysql.sql populate-oracle.sql populate-postgres.sql populate-sybase.sql turbine-db2.sql turbine-hypersonic.sql turbine-mysql.sql turbine-oracle.sql turbine-postgres.sql turbine-sqlserver.sql turbine-sybase.sql
Date Thu, 05 Dec 2002 20:00:08 GMT
taylor      2002/12/05 12:00:08

  Modified:    src/sql/external coffees-oracle.sql populate-db2.sql
                        populate-mysql.sql populate-oracle.sql
                        populate-postgres.sql populate-sybase.sql
                        turbine-db2.sql turbine-hypersonic.sql
                        turbine-mysql.sql turbine-oracle.sql
                        turbine-postgres.sql turbine-sqlserver.sql
                        turbine-sybase.sql
  Log:
  added primary key to coffees table
  
  Revision  Changes    Path
  1.2       +11 -11    jakarta-jetspeed/src/sql/external/coffees-oracle.sql
  
  Index: coffees-oracle.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/coffees-oracle.sql,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- coffees-oracle.sql	14 May 2002 06:44:36 -0000	1.1
  +++ coffees-oracle.sql	5 Dec 2002 20:00:07 -0000	1.2
  @@ -1,12 +1,12 @@
  -INSERT INTO COFFEES VALUES('ColombianGrade',5,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KonaGrade',6,8.99,1,2);
  -INSERT INTO COFFEES VALUES('FrenchRoastGrade',7,7.66,1,2);
  -INSERT INTO COFFEES VALUES('HazelNutGrade',8,9.99,1,2);
  -INSERT INTO COFFEES VALUES('VanillaGrade',9,9.99,1,2);
  -INSERT INTO COFFEES VALUES('JavaGrade',10,6.99,1,2);
  -INSERT INTO COFFEES VALUES('IndonesianGrade',11,7.99,1,2);
  -INSERT INTO COFFEES VALUES('OotyGrade',1,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KenyanGrade',2,9.99,1,2);
  -INSERT INTO COFFEES VALUES('JoeGrade',3,5.99,1,2);
  -INSERT INTO COFFEES VALUES('CantThinkOfAnymoreGrade',4,1.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'ColombianGrade',5,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'KonaGrade',6,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'FrenchRoastGrade',7,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'HazelNutGrade',8,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'VanillaGrade',9,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'JavaGrade',10,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'IndonesianGrade',11,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'OotyGrade',1,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'KenyanGrade',2,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'JoeGrade',3,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'CantThinkOfAnymoreGrade',4,7.99,1,2);
   
  
  
  
  1.9       +11 -11    jakarta-jetspeed/src/sql/external/populate-db2.sql
  
  Index: populate-db2.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/populate-db2.sql,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- populate-db2.sql	18 Oct 2002 22:08:36 -0000	1.8
  +++ populate-db2.sql	5 Dec 2002 20:00:07 -0000	1.9
  @@ -33,15 +33,15 @@
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(1,1,1);
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(1,1,2);
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(3,1,3);
  -INSERT INTO COFFEES VALUES('ColombianGrade',5,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KonaGrade',6,7.99,1,2);
  -INSERT INTO COFFEES VALUES('FrenchRoastGrade',7,7.99,1,2);
  -INSERT INTO COFFEES VALUES('HazelNutGrade',8,7.99,1,2);
  -INSERT INTO COFFEES VALUES('VanillaGrade',9,7.99,1,2);
  -INSERT INTO COFFEES VALUES('JavaGrade',10,7.99,1,2);
  -INSERT INTO COFFEES VALUES('IndonesianGrade',11,7.99,1,2);
  -INSERT INTO COFFEES VALUES('OotyGrade',1,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KenyanGrade',2,7.99,1,2);
  -INSERT INTO COFFEES VALUES('JoeGrade',3,7.99,1,2);
  -INSERT INTO COFFEES VALUES('CantThinkOfAnymoreGrade',4,7.99,1,2);
  +INSERT INTO COFFEES VALUES(1,'ColombianGrade',5,7.99,1,2);
  +INSERT INTO COFFEES VALUES(2,'KonaGrade',6,7.99,1,2);
  +INSERT INTO COFFEES VALUES(3,'FrenchRoastGrade',7,7.99,1,2);
  +INSERT INTO COFFEES VALUES(4,'HazelNutGrade',8,7.99,1,2);
  +INSERT INTO COFFEES VALUES(5,'VanillaGrade',9,7.99,1,2);
  +INSERT INTO COFFEES VALUES(6,'JavaGrade',10,7.99,1,2);
  +INSERT INTO COFFEES VALUES(7,'IndonesianGrade',11,7.99,1,2);
  +INSERT INTO COFFEES VALUES(8,'OotyGrade',1,7.99,1,2);
  +INSERT INTO COFFEES VALUES(9,'KenyanGrade',2,7.99,1,2);
  +INSERT INTO COFFEES VALUES(10,'JoeGrade',3,7.99,1,2);
  +INSERT INTO COFFEES VALUES(11,'CantThinkOfAnymoreGrade',4,7.99,1,2);
   
  
  
  
  1.12      +11 -11    jakarta-jetspeed/src/sql/external/populate-mysql.sql
  
  Index: populate-mysql.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/populate-mysql.sql,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- populate-mysql.sql	18 Oct 2002 00:50:11 -0000	1.11
  +++ populate-mysql.sql	5 Dec 2002 20:00:07 -0000	1.12
  @@ -33,15 +33,15 @@
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(1,1,1);
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(1,1,2);
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(3,1,3);
  -INSERT INTO COFFEES VALUES('ColombianGrade',5,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KonaGrade',6,7.99,1,2);
  -INSERT INTO COFFEES VALUES('FrenchRoastGrade',7,7.99,1,2);
  -INSERT INTO COFFEES VALUES('HazelNutGrade',8,7.99,1,2);
  -INSERT INTO COFFEES VALUES('VanillaGrade',9,7.99,1,2);
  -INSERT INTO COFFEES VALUES('JavaGrade',10,7.99,1,2);
  -INSERT INTO COFFEES VALUES('IndonesianGrade',11,7.99,1,2);
  -INSERT INTO COFFEES VALUES('OotyGrade',1,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KenyanGrade',2,7.99,1,2);
  -INSERT INTO COFFEES VALUES('JoeGrade',3,7.99,1,2);
  -INSERT INTO COFFEES VALUES('CantThinkOfAnymoreGrade',4,7.99,1,2);
  +INSERT INTO COFFEES VALUES(1,'ColombianGrade',5,7.99,1,2);
  +INSERT INTO COFFEES VALUES(2,'KonaGrade',6,7.99,1,2);
  +INSERT INTO COFFEES VALUES(3,'FrenchRoastGrade',7,7.99,1,2);
  +INSERT INTO COFFEES VALUES(4,'HazelNutGrade',8,7.99,1,2);
  +INSERT INTO COFFEES VALUES(5,'VanillaGrade',9,7.99,1,2);
  +INSERT INTO COFFEES VALUES(6,'JavaGrade',10,7.99,1,2);
  +INSERT INTO COFFEES VALUES(7,'IndonesianGrade',11,7.99,1,2);
  +INSERT INTO COFFEES VALUES(8,'OotyGrade',1,7.99,1,2);
  +INSERT INTO COFFEES VALUES(9,'KenyanGrade',2,7.99,1,2);
  +INSERT INTO COFFEES VALUES(10,'JoeGrade',3,7.99,1,2);
  +INSERT INTO COFFEES VALUES(11,'CantThinkOfAnymoreGrade',4,7.99,1,2);
   
  
  
  
  1.8       +11 -11    jakarta-jetspeed/src/sql/external/populate-oracle.sql
  
  Index: populate-oracle.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/populate-oracle.sql,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- populate-oracle.sql	18 Oct 2002 00:50:11 -0000	1.7
  +++ populate-oracle.sql	5 Dec 2002 20:00:07 -0000	1.8
  @@ -70,15 +70,15 @@
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(getUserId('admin'),getGroupId('Jetspeed'),getRoleId('user'));
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(getUserId('admin'),getGroupId('Jetspeed'),getRoleId('admin'));
   INSERT INTO TURBINE_USER_GROUP_ROLE VALUES(getUserId('anon'),getGroupId('Jetspeed'),getRoleId('guest'));
  -INSERT INTO COFFEES VALUES('ColombianGrade',5,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KonaGrade',6,7.99,1,2);
  -INSERT INTO COFFEES VALUES('FrenchRoastGrade',7,7.99,1,2);
  -INSERT INTO COFFEES VALUES('HazelNutGrade',8,7.99,1,2);
  -INSERT INTO COFFEES VALUES('VanillaGrade',9,7.99,1,2);
  -INSERT INTO COFFEES VALUES('JavaGrade',10,7.99,1,2);
  -INSERT INTO COFFEES VALUES('IndonesianGrade',11,7.99,1,2);
  -INSERT INTO COFFEES VALUES('OotyGrade',1,7.99,1,2);
  -INSERT INTO COFFEES VALUES('KenyanGrade',2,7.99,1,2);
  -INSERT INTO COFFEES VALUES('JoeGrade',3,7.99,1,2);
  -INSERT INTO COFFEES VALUES('CantThinkOfAnymoreGrade',4,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'ColombianGrade',5,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'KonaGrade',6,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'FrenchRoastGrade',7,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'HazelNutGrade',8,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'VanillaGrade',9,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'JavaGrade',10,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'IndonesianGrade',11,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'OotyGrade',1,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'KenyanGrade',2,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'JoeGrade',3,7.99,1,2);
  +INSERT INTO COFFEES VALUES(coffees_seq.nextval,'CantThinkOfAnymoreGrade',4,7.99,1,2);
   
  
  
  
  1.9       +11 -0     jakarta-jetspeed/src/sql/external/populate-postgres.sql
  
  Index: populate-postgres.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/populate-postgres.sql,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- populate-postgres.sql	28 Jun 2002 05:37:36 -0000	1.8
  +++ populate-postgres.sql	5 Dec 2002 20:00:07 -0000	1.9
  @@ -44,5 +44,16 @@
   INSERT INTO ID_TABLE VALUES(9,'JETSPEED_GROUP_PROFILE',120,10);
   INSERT INTO ID_TABLE VALUES(10,'JETSPEED_ROLE_PROFILE',120,10);
   INSERT INTO ID_TABLE VALUES(11,'JETSPEED_ANON_PROFILE',120,10);
  +INSERT INTO COFFEES VALUES(1,'ColombianGrade',5,7.99,1,2);
  +INSERT INTO COFFEES VALUES(2,'KonaGrade',6,7.99,1,2);
  +INSERT INTO COFFEES VALUES(3,'FrenchRoastGrade',7,7.99,1,2);
  +INSERT INTO COFFEES VALUES(4,'HazelNutGrade',8,7.99,1,2);
  +INSERT INTO COFFEES VALUES(5,'VanillaGrade',9,7.99,1,2);
  +INSERT INTO COFFEES VALUES(6,'JavaGrade',10,7.99,1,2);
  +INSERT INTO COFFEES VALUES(7,'IndonesianGrade',11,7.99,1,2);
  +INSERT INTO COFFEES VALUES(8,'OotyGrade',1,7.99,1,2);
  +INSERT INTO COFFEES VALUES(9,'KenyanGrade',2,7.99,1,2);
  +INSERT INTO COFFEES VALUES(10,'JoeGrade',3,7.99,1,2);
  +INSERT INTO COFFEES VALUES(11,'CantThinkOfAnymoreGrade',4,7.99,1,2);
   
   
  
  
  
  1.8       +12 -1     jakarta-jetspeed/src/sql/external/populate-sybase.sql
  
  Index: populate-sybase.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/populate-sybase.sql,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- populate-sybase.sql	28 Jun 2002 05:37:36 -0000	1.7
  +++ populate-sybase.sql	5 Dec 2002 20:00:07 -0000	1.8
  @@ -44,5 +44,16 @@
   INSERT INTO ID_TABLE VALUES(9,'JETSPEED_GROUP_PROFILE',120,10);
   INSERT INTO ID_TABLE VALUES(10,'JETSPEED_ROLE_PROFILE',120,10);
   INSERT INTO ID_TABLE VALUES(11,'JETSPEED_ANON_PROFILE',120,10);
  -
  +INSERT INTO ID_TABLE VALUES(12,'COFFEES',100,10)
  +INSERT INTO COFFEES VALUES(1,'ColombianGrade',5,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(2,'KonaGrade',6,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(3,'FrenchRoastGrade',7,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(4,'HazelNutGrade',8,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(5,'VanillaGrade',9,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(6,'JavaGrade',10,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(7,'IndonesianGrade',11,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(8,'OotyGrade',1,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(9,'KenyanGrade',2,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(10,'JoeGrade',3,7.99E0,1,2)
  +INSERT INTO COFFEES VALUES(11,'CantThinkOfAnymoreGrade',4,7.99E0,1,2)
   
  
  
  
  1.5       +4 -3      jakarta-jetspeed/src/sql/external/turbine-db2.sql
  
  Index: turbine-db2.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-db2.sql,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- turbine-db2.sql	18 Oct 2002 22:08:36 -0000	1.4
  +++ turbine-db2.sql	5 Dec 2002 20:00:07 -0000	1.5
  @@ -211,15 +211,16 @@
   
   CREATE TABLE COFFEES
   (
  -            COF_NAME VARCHAR (50),
  -            SUP_ID INTEGER,
  +            COFFEE_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
  +            COFFEE_NAME VARCHAR (50),
  +            SUPPLIER_ID INTEGER,
               PRICE FLOAT,
               SALES INTEGER,
               TOTAL INTEGER
   );
   
   ALTER TABLE COFFEES
  -    ADD PRIMARY KEY ();
  +    ADD PRIMARY KEY (COFFEE_ID);
   
   
   
  
  
  
  1.4       +14 -0     jakarta-jetspeed/src/sql/external/turbine-hypersonic.sql
  
  Index: turbine-hypersonic.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-hypersonic.sql,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- turbine-hypersonic.sql	25 Feb 2002 04:15:43 -0000	1.3
  +++ turbine-hypersonic.sql	5 Dec 2002 20:00:07 -0000	1.4
  @@ -106,3 +106,17 @@
   );
   
   
  +-----------------------------------------------------------------------------
  +-- COFFEES
  +-----------------------------------------------------------------------------
  +CREATE TABLE COFFEES
  +(
  +    COFFEE_ID integer IDENTITY,
  +    COFFEE_NAME VARCHAR (50),
  +    SUPPLIER_ID integer,
  +    PRICE FLOAT,
  +    SALES integer,
  +    TOTAL integer
  +);
  +
  +
  
  
  
  1.8       +7 -6      jakarta-jetspeed/src/sql/external/turbine-mysql.sql
  
  Index: turbine-mysql.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-mysql.sql,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- turbine-mysql.sql	18 Oct 2002 00:50:11 -0000	1.7
  +++ turbine-mysql.sql	5 Dec 2002 20:00:07 -0000	1.8
  @@ -158,13 +158,14 @@
   
   CREATE TABLE COFFEES
   (
  -        COF_NAME VARCHAR (50),
  -        SUP_ID INTEGER,
  -        PRICE FLOAT,
  -        SALES INTEGER,
  -        TOTAL INTEGER
  +   COFFEE_ID INTEGER NOT NULL AUTO_INCREMENT,
  +   COFFEE_NAME VARCHAR (50),
  +   SUPPLIER_ID INTEGER,
  +   PRICE FLOAT,
  +   SALES INTEGER,
  +   TOTAL INTEGER,
  +   PRIMARY KEY(COFFEE_ID)
   );
  -    
       
     
     
  
  
  
  1.8       +10 -2     jakarta-jetspeed/src/sql/external/turbine-oracle.sql
  
  Index: turbine-oracle.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-oracle.sql,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- turbine-oracle.sql	18 Oct 2002 00:50:11 -0000	1.7
  +++ turbine-oracle.sql	5 Dec 2002 20:00:07 -0000	1.8
  @@ -252,16 +252,24 @@
   -- COFFEES
   -----------------------------------------------------------------------------
   DROP TABLE COFFEES CASCADE CONSTRAINTS;
  +DROP SEQUENCE COFFEES_SEQ;
   
   CREATE TABLE COFFEES
   (
  -    COF_NAME VARCHAR2 (50),
  -    SUP_ID NUMBER,
  +    COFFEE_ID NUMBER NOT NULL,
  +    COFFEE_NAME VARCHAR2 (50),
  +    SUPPLIER_ID NUMBER,
       PRICE FLOAT,
       SALES NUMBER,
       TOTAL NUMBER
   );
   
  +ALTER TABLE COFFEES
  +    ADD CONSTRAINT COFFEES_PK
  +PRIMARY KEY (COFFEE_ID);
  +
  +
  +CREATE SEQUENCE COFFEES_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
   
   
   
  
  
  
  1.5       +18 -0     jakarta-jetspeed/src/sql/external/turbine-postgres.sql
  
  Index: turbine-postgres.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-postgres.sql,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- turbine-postgres.sql	25 Feb 2002 04:15:43 -0000	1.4
  +++ turbine-postgres.sql	5 Dec 2002 20:00:07 -0000	1.5
  @@ -140,4 +140,22 @@
       UNIQUE (TABLE_NAME)
   );
   
  +-----------------------------------------------------------------------------
  +-- COFFEES
  +-----------------------------------------------------------------------------
  +DROP TABLE COFFEES;
  +DROP SEQUENCE COFFEES_SEQ;
  +
  +CREATE SEQUENCE COFFEES_SEQ;
  +
  +CREATE TABLE COFFEES
  +(
  +    COFFEE_ID serial,
  +    COFFEE_NAME varchar (50),
  +    SUPPLIER_ID integer,
  +    PRICE float,
  +    SALES integer,
  +    TOTAL integer,
  +    PRIMARY KEY (COFFEE_ID)
  +);
   
  
  
  
  1.4       +1 -1      jakarta-jetspeed/src/sql/external/turbine-sqlserver.sql
  
  Index: turbine-sqlserver.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-sqlserver.sql,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- turbine-sqlserver.sql	18 Oct 2002 19:16:32 -0000	1.3
  +++ turbine-sqlserver.sql	5 Dec 2002 20:00:07 -0000	1.4
  @@ -1 +1 @@
  -/* ---------------------------------------------------------------------- */
/* TURBINE_USER                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_USER')
BEGIN
     DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_USER'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_1, @constraintname_1
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_1+' drop constraint '+@constraintname_1)
       FETCH NEXT from refcursor into @reftable_1, @constraintname_1
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_USER
END


CREATE TABLE TURBINE_USER
(
            USER_ID INT NOT NULL IDENTITY (1,1),
            LOGIN_NAME VARCHAR (32) NOT NULL,
            PASSWORD_VALUE VARCHAR (32) NOT NULL,
            FIRST_NAME VARCHAR (99) NOT NULL,
            LAST_NAME VARCHAR (99) NOT NULL,
            EMAIL VARCHAR (99) NULL,
            CONFIRM_VALUE VARCHAR (99) NULL,
            MODIFIED DATETIME NULL,
            CREATED DATETIME NULL,
            LAST_LOGIN DATETIME NULL,
            DISABLED CHAR (1) NULL,
            OBJECTDATA BINARY(7132) NULL,
            PASSWORD_CHANGED DATETIME NULL,

    CONSTRAINT TURBINE_USER_PK PRIMARY KEY(USER_ID),
    UNIQUE (LOGIN_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_ROLE')
BEGIN
     DECLARE @reftable_2 nvarchar(60), @constraintname_2 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_ROLE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_2, @constraintname_2
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_2+' drop constraint '+@constraintname_2)
       FETCH NEXT from refcursor into @reftable_2, @constraintname_2
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_ROLE
END


CREATE TABLE TURBINE_ROLE
(
            ROLE_ID INT NOT NULL IDENTITY (1,1),
            ROLE_NAME VARCHAR (99) NOT NULL,
            OBJECTDATA BINARY(7132) NULL,

    CONSTRAINT TURBINE_ROLE_PK PRIMARY KEY(ROLE_ID),
    UNIQUE (ROLE_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_GROUP                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_GROUP')
BEGIN
     DECLARE @reftable_3 nvarchar(60), @constraintname_3 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_GROUP'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_3, @constraintname_3
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_3+' drop constraint '+@constraintname_3)
       FETCH NEXT from refcursor into @reftable_3, @constraintname_3
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_GROUP
END


CREATE TABLE TURBINE_GROUP
(
            GROUP_ID INT NOT NULL IDENTITY (1,1),
            GROUP_NAME VARCHAR (99) NOT NULL,
            OBJECTDATA BINARY(7132) NULL,

    CONSTRAINT TURBINE_GROUP_PK PRIMARY KEY(GROUP_ID),
    UNIQUE (GROUP_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_PERMISSION')
BEGIN
     DECLARE @reftable_4 nvarchar(60), @constraintname_4 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_PERMISSION'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_4, @constraintname_4
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_4+' drop constraint '+@constraintname_4)
       FETCH NEXT from refcursor into @reftable_4, @constraintname_4
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_PERMISSION
END


CREATE TABLE TURBINE_PERMISSION
(
            PERMISSION_ID INT NOT NULL IDENTITY (1,1),
            PERMISSION_NAME VARCHAR (99) NOT NULL,
            OBJECTDATA BINARY(7132) NULL,

    CONSTRAINT TURBINE_PERMISSION_PK PRIMARY KEY(PERMISSION_ID),
    UNIQUE (PERMISSION_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_ROLE_PERMISSION_FK_1')
    ALTER TABLE TURBINE_ROLE_PERMISSION DROP CONSTRAINT TURBINE_ROLE_PERMISSION_FK_1;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_ROLE_PERMISSION_FK_2')
    ALTER TABLE TURBINE_ROLE_PERMISSION DROP CONSTRAINT TURBINE_ROLE_PERMISSION_FK_2;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_ROLE_PERMISSION')
BEGIN
     DECLARE @reftable_5 nvarchar(60), @constraintname_5 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_ROLE_PERMISSION'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_5, @constraintname_5
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_5+' drop constraint '+@constraintname_5)
       FETCH NEXT from refcursor into @reftable_5, @constraintname_5
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_ROLE_PERMISSION
END


CREATE TABLE TURBINE_ROLE_PERMISSION
(
            ROLE_ID INT NOT NULL,
            PERMISSION_ID INT NOT NULL,

    CONSTRAINT TURBINE_ROLE_PERMISSION_PK PRIMARY KEY(ROLE_ID,PERMISSION_ID));





/* ---------------------------------------------------------------------- */
/* TURBINE_USER_GROUP_ROLE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_USER_GROUP_ROLE_FK_1')
    ALTER TABLE TURBINE_USER_GROUP_ROLE DROP CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_1;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_USER_GROUP_ROLE_FK_2')
    ALTER TABLE TURBINE_USER_GROUP_ROLE DROP CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_2;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_USER_GROUP_ROLE_FK_3')
    ALTER TABLE TURBINE_USER_GROUP_ROLE DROP CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_3;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_USER_GROUP_ROLE')
BEGIN
     DECLARE @reftable_6 nvarchar(60), @constraintname_6 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_USER_GROUP_ROLE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_6, @constraintname_6
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_6+' drop constraint '+@constraintname_6)
       FETCH NEXT from refcursor into @reftable_6, @constraintname_6
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_USER_GROUP_ROLE
END


CREATE TABLE TURBINE_USER_GROUP_ROLE
(
            USER_ID INT NOT NULL,
            GROUP_ID INT NOT NULL,
            ROLE_ID INT NOT NULL,

    CONSTRAINT TURBINE_USER_GROUP_ROLE_PK PRIMARY KEY(USER_ID,GROUP_ID,ROLE_ID));





/* ---------------------------------------------------------------------- */
/* TURBINE_USER_GROUP_ROLE                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_USER                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_GROUP                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

BEGIN
ALTER TABLE TURBINE_ROLE_PERMISSION
    ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_1 FOREIGN KEY (ROLE_ID)
    REFERENCES TURBINE_ROLE (ROLE_ID)
    ON DELETE CASCADE 
END    
;

BEGIN
ALTER TABLE TURBINE_ROLE_PERMISSION
    ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_2 FOREIGN KEY (PERMISSION_ID)
    REFERENCES TURBINE_PERMISSION (PERMISSION_ID)
    ON DELETE CASCADE 
END    
;




/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

BEGIN
ALTER TABLE TURBINE_USER_GROUP_ROLE
    ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_1 FOREIGN KEY (USER_ID)
    REFERENCES TURBINE_USER (USER_ID)
    ON DELETE CASCADE 
END    
;

BEGIN
ALTER TABLE TURBINE_USER_GROUP_ROLE
    ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_2 FOREIGN KEY (GROUP_ID)
    REFERENCES TURBINE_GROUP (GROUP_ID)
    ON DELETE CASCADE 
END    
;

BEGIN
ALTER TABLE TURBINE_USER_GROUP_ROLE
    ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_3 FOREIGN KEY (ROLE_ID)
    REFERENCES TURBINE_ROLE (ROLE_ID)
    ON DELETE CASCADE 
END    
;



/* ---------------------------------------------------------------------- */
/* JETSPEED_USER_PROFILE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'JETSPEED_USER_PROFILE')
BEGIN
     DECLARE @reftable_11 nvarchar(60), @constraintname_11 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'JETSPEED_USER_PROFILE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_11, @constraintname_11
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_11+' drop constraint '+@constraintname_11)
       FETCH NEXT from refcursor into @reftable_11, @constraintname_11
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE JETSPEED_USER_PROFILE
END


CREATE TABLE JETSPEED_USER_PROFILE
(
            PSML_ID INT NOT NULL IDENTITY (1,1),
            USER_NAME VARCHAR (32) NOT NULL,
            MEDIA_TYPE VARCHAR (99) NULL,
            LANGUAGE VARCHAR (2) NULL,
            COUNTRY VARCHAR (2) NULL,
            PAGE VARCHAR (99) NULL,
            PROFILE BINARY NULL,

    CONSTRAINT JETSPEED_USER_PROFILE_PK PRIMARY KEY(PSML_ID),
    UNIQUE (USER_NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE));





/* ---------------------------------------------------------------------- */
/* JETSPEED_GROUP_PROFILE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'JETSPEED_GROUP_PROFILE')
BEGIN
     DECLARE @reftable_12 nvarchar(60), @constraintname_12 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'JETSPEED_GROUP_PROFILE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_12, @constraintname_12
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_12+' drop constraint '+@constraintname_12)
       FETCH NEXT from refcursor into @reftable_12, @constraintname_2
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE JETSPEED_GROUP_PROFILE
END


CREATE TABLE JETSPEED_GROUP_PROFILE
(
            PSML_ID INT NOT NULL IDENTITY (1,1),
            GROUP_NAME VARCHAR (99) NOT NULL,
            MEDIA_TYPE VARCHAR (99) NULL,
            LANGUAGE VARCHAR (2) NULL,
            COUNTRY VARCHAR (2) NULL,
            PAGE VARCHAR (99) NULL,
            PROFILE BINARY NULL,

    CONSTRAINT JETSPEED_GROUP_PROFILE_PK PRIMARY KEY(PSML_ID),
    UNIQUE (GROUP_NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE));





/* ---------------------------------------------------------------------- */
/* JETSPEED_ROLE_PROFILE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'JETSPEED_ROLE_PROFILE')
BEGIN
     DECLARE @reftable_13 nvarchar(60), @constraintname_13 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'JETSPEED_ROLE_PROFILE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_13, @constraintname_13
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_13+' drop constraint '+@constraintname_13)
       FETCH NEXT from refcursor into @reftable_13, @constraintname_13
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE JETSPEED_ROLE_PROFILE
END


CREATE TABLE JETSPEED_ROLE_PROFILE
(
            PSML_ID INT NOT NULL IDENTITY (1,1),
            ROLE_NAME VARCHAR (99) NOT NULL,
            MEDIA_TYPE VARCHAR (99) NULL,
            LANGUAGE VARCHAR (2) NULL,
            COUNTRY VARCHAR (2) NULL,
            PAGE VARCHAR (99) NULL,
            PROFILE BINARY NULL,

    CONSTRAINT JETSPEED_ROLE_PROFILE_PK PRIMARY KEY(PSML_ID),
    UNIQUE (ROLE_NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE));


/* ---------------------------------------------------------------------- */
/* COFFEES                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'COFFEES')
BEGIN
     DECLARE @reftable_14 nvarchar(60), @constraintname_14 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'COFFEES'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_14, @constraintname_14
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_14+' drop constraint '+@constraintname_14)
       FETCH NEXT from refcursor into @reftable_14, @constraintname_14
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE COFFEES
END


CREATE TABLE COFFEES
(
            COF_NAME VARCHAR (50) NULL,
            SUP_ID INT NULL,
            PRICE FLOAT NULL,
            SALES INT NULL,
            TOTAL INT NULL,
);


  \ No newline at end of file
  +/* ---------------------------------------------------------------------- */
/* TURBINE_USER                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_USER')
BEGIN
     DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_USER'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_1, @constraintname_1
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_1+' drop constraint '+@constraintname_1)
       FETCH NEXT from refcursor into @reftable_1, @constraintname_1
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_USER
END


CREATE TABLE TURBINE_USER
(
            USER_ID INT NOT NULL IDENTITY (1,1),
            LOGIN_NAME VARCHAR (32) NOT NULL,
            PASSWORD_VALUE VARCHAR (32) NOT NULL,
            FIRST_NAME VARCHAR (99) NOT NULL,
            LAST_NAME VARCHAR (99) NOT NULL,
            EMAIL VARCHAR (99) NULL,
            CONFIRM_VALUE VARCHAR (99) NULL,
            MODIFIED DATETIME NULL,
            CREATED DATETIME NULL,
            LAST_LOGIN DATETIME NULL,
            DISABLED CHAR (1) NULL,
            OBJECTDATA BINARY(7132) NULL,
            PASSWORD_CHANGED DATETIME NULL,

    CONSTRAINT TURBINE_USER_PK PRIMARY KEY(USER_ID),
    UNIQUE (LOGIN_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_ROLE')
BEGIN
     DECLARE @reftable_2 nvarchar(60), @constraintname_2 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_ROLE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_2, @constraintname_2
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_2+' drop constraint '+@constraintname_2)
       FETCH NEXT from refcursor into @reftable_2, @constraintname_2
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_ROLE
END


CREATE TABLE TURBINE_ROLE
(
            ROLE_ID INT NOT NULL IDENTITY (1,1),
            ROLE_NAME VARCHAR (99) NOT NULL,
            OBJECTDATA BINARY(7132) NULL,

    CONSTRAINT TURBINE_ROLE_PK PRIMARY KEY(ROLE_ID),
    UNIQUE (ROLE_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_GROUP                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_GROUP')
BEGIN
     DECLARE @reftable_3 nvarchar(60), @constraintname_3 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_GROUP'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_3, @constraintname_3
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_3+' drop constraint '+@constraintname_3)
       FETCH NEXT from refcursor into @reftable_3, @constraintname_3
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_GROUP
END


CREATE TABLE TURBINE_GROUP
(
            GROUP_ID INT NOT NULL IDENTITY (1,1),
            GROUP_NAME VARCHAR (99) NOT NULL,
            OBJECTDATA BINARY(7132) NULL,

    CONSTRAINT TURBINE_GROUP_PK PRIMARY KEY(GROUP_ID),
    UNIQUE (GROUP_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_PERMISSION')
BEGIN
     DECLARE @reftable_4 nvarchar(60), @constraintname_4 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_PERMISSION'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_4, @constraintname_4
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_4+' drop constraint '+@constraintname_4)
       FETCH NEXT from refcursor into @reftable_4, @constraintname_4
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_PERMISSION
END


CREATE TABLE TURBINE_PERMISSION
(
            PERMISSION_ID INT NOT NULL IDENTITY (1,1),
            PERMISSION_NAME VARCHAR (99) NOT NULL,
            OBJECTDATA BINARY(7132) NULL,

    CONSTRAINT TURBINE_PERMISSION_PK PRIMARY KEY(PERMISSION_ID),
    UNIQUE (PERMISSION_NAME));





/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_ROLE_PERMISSION_FK_1')
    ALTER TABLE TURBINE_ROLE_PERMISSION DROP CONSTRAINT TURBINE_ROLE_PERMISSION_FK_1;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_ROLE_PERMISSION_FK_2')
    ALTER TABLE TURBINE_ROLE_PERMISSION DROP CONSTRAINT TURBINE_ROLE_PERMISSION_FK_2;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_ROLE_PERMISSION')
BEGIN
     DECLARE @reftable_5 nvarchar(60), @constraintname_5 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_ROLE_PERMISSION'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_5, @constraintname_5
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_5+' drop constraint '+@constraintname_5)
       FETCH NEXT from refcursor into @reftable_5, @constraintname_5
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_ROLE_PERMISSION
END


CREATE TABLE TURBINE_ROLE_PERMISSION
(
            ROLE_ID INT NOT NULL,
            PERMISSION_ID INT NOT NULL,

    CONSTRAINT TURBINE_ROLE_PERMISSION_PK PRIMARY KEY(ROLE_ID,PERMISSION_ID));





/* ---------------------------------------------------------------------- */
/* TURBINE_USER_GROUP_ROLE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_USER_GROUP_ROLE_FK_1')
    ALTER TABLE TURBINE_USER_GROUP_ROLE DROP CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_1;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_USER_GROUP_ROLE_FK_2')
    ALTER TABLE TURBINE_USER_GROUP_ROLE DROP CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_2;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name='TURBINE_USER_GROUP_ROLE_FK_3')
    ALTER TABLE TURBINE_USER_GROUP_ROLE DROP CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_3;
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'TURBINE_USER_GROUP_ROLE')
BEGIN
     DECLARE @reftable_6 nvarchar(60), @constraintname_6 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'TURBINE_USER_GROUP_ROLE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_6, @constraintname_6
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_6+' drop constraint '+@constraintname_6)
       FETCH NEXT from refcursor into @reftable_6, @constraintname_6
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE TURBINE_USER_GROUP_ROLE
END


CREATE TABLE TURBINE_USER_GROUP_ROLE
(
            USER_ID INT NOT NULL,
            GROUP_ID INT NOT NULL,
            ROLE_ID INT NOT NULL,

    CONSTRAINT TURBINE_USER_GROUP_ROLE_PK PRIMARY KEY(USER_ID,GROUP_ID,ROLE_ID));





/* ---------------------------------------------------------------------- */
/* TURBINE_USER_GROUP_ROLE                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_USER                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_GROUP                                                      */
/* ---------------------------------------------------------------------- */




/* ---------------------------------------------------------------------- */
/* TURBINE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

BEGIN
ALTER TABLE TURBINE_ROLE_PERMISSION
    ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_1 FOREIGN KEY (ROLE_ID)
    REFERENCES TURBINE_ROLE (ROLE_ID)
    ON DELETE CASCADE 
END    
;

BEGIN
ALTER TABLE TURBINE_ROLE_PERMISSION
    ADD CONSTRAINT TURBINE_ROLE_PERMISSION_FK_2 FOREIGN KEY (PERMISSION_ID)
    REFERENCES TURBINE_PERMISSION (PERMISSION_ID)
    ON DELETE CASCADE 
END    
;




/* ---------------------------------------------------------------------- */
/* TURBINE_ROLE_PERMISSION                                                      */
/* ---------------------------------------------------------------------- */

BEGIN
ALTER TABLE TURBINE_USER_GROUP_ROLE
    ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_1 FOREIGN KEY (USER_ID)
    REFERENCES TURBINE_USER (USER_ID)
    ON DELETE CASCADE 
END    
;

BEGIN
ALTER TABLE TURBINE_USER_GROUP_ROLE
    ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_2 FOREIGN KEY (GROUP_ID)
    REFERENCES TURBINE_GROUP (GROUP_ID)
    ON DELETE CASCADE 
END    
;

BEGIN
ALTER TABLE TURBINE_USER_GROUP_ROLE
    ADD CONSTRAINT TURBINE_USER_GROUP_ROLE_FK_3 FOREIGN KEY (ROLE_ID)
    REFERENCES TURBINE_ROLE (ROLE_ID)
    ON DELETE CASCADE 
END    
;



/* ---------------------------------------------------------------------- */
/* JETSPEED_USER_PROFILE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'JETSPEED_USER_PROFILE')
BEGIN
     DECLARE @reftable_11 nvarchar(60), @constraintname_11 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'JETSPEED_USER_PROFILE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_11, @constraintname_11
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_11+' drop constraint '+@constraintname_11)
       FETCH NEXT from refcursor into @reftable_11, @constraintname_11
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE JETSPEED_USER_PROFILE
END


CREATE TABLE JETSPEED_USER_PROFILE
(
            PSML_ID INT NOT NULL IDENTITY (1,1),
            USER_NAME VARCHAR (32) NOT NULL,
            MEDIA_TYPE VARCHAR (99) NULL,
            LANGUAGE VARCHAR (2) NULL,
            COUNTRY VARCHAR (2) NULL,
            PAGE VARCHAR (99) NULL,
            PROFILE BINARY NULL,

    CONSTRAINT JETSPEED_USER_PROFILE_PK PRIMARY KEY(PSML_ID),
    UNIQUE (USER_NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE));





/* ---------------------------------------------------------------------- */
/* JETSPEED_GROUP_PROFILE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'JETSPEED_GROUP_PROFILE')
BEGIN
     DECLARE @reftable_12 nvarchar(60), @constraintname_12 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'JETSPEED_GROUP_PROFILE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_12, @constraintname_12
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_12+' drop constraint '+@constraintname_12)
       FETCH NEXT from refcursor into @reftable_12, @constraintname_2
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE JETSPEED_GROUP_PROFILE
END


CREATE TABLE JETSPEED_GROUP_PROFILE
(
            PSML_ID INT NOT NULL IDENTITY (1,1),
            GROUP_NAME VARCHAR (99) NOT NULL,
            MEDIA_TYPE VARCHAR (99) NULL,
            LANGUAGE VARCHAR (2) NULL,
            COUNTRY VARCHAR (2) NULL,
            PAGE VARCHAR (99) NULL,
            PROFILE BINARY NULL,

    CONSTRAINT JETSPEED_GROUP_PROFILE_PK PRIMARY KEY(PSML_ID),
    UNIQUE (GROUP_NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE));





/* ---------------------------------------------------------------------- */
/* JETSPEED_ROLE_PROFILE                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'JETSPEED_ROLE_PROFILE')
BEGIN
     DECLARE @reftable_13 nvarchar(60), @constraintname_13 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'JETSPEED_ROLE_PROFILE'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_13, @constraintname_13
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_13+' drop constraint '+@constraintname_13)
       FETCH NEXT from refcursor into @reftable_13, @constraintname_13
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE JETSPEED_ROLE_PROFILE
END


CREATE TABLE JETSPEED_ROLE_PROFILE
(
            PSML_ID INT NOT NULL IDENTITY (1,1),
            ROLE_NAME VARCHAR (99) NOT NULL,
            MEDIA_TYPE VARCHAR (99) NULL,
            LANGUAGE VARCHAR (2) NULL,
            COUNTRY VARCHAR (2) NULL,
            PAGE VARCHAR (99) NULL,
            PROFILE BINARY NULL,

    CONSTRAINT JETSPEED_ROLE_PROFILE_PK PRIMARY KEY(PSML_ID),
    UNIQUE (ROLE_NAME, MEDIA_TYPE, LANGUAGE, COUNTRY, PAGE));


/* ---------------------------------------------------------------------- */
/* COFFEES                                                      */
/* ---------------------------------------------------------------------- */

IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'COFFEES')
BEGIN
     DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60)
     DECLARE refcursor CURSOR FOR
     select reftables.name tablename, cons.name constraintname
      from sysobjects tables,
           sysobjects reftables,
           sysobjects cons,
           sysreferences ref
       where tables.id = ref.rkeyid
         and cons.id = ref.constid
         and reftables.id = ref.fkeyid
         and tables.name = 'COFFEES'
     OPEN refcursor
     FETCH NEXT from refcursor into @reftable_1, @constraintname_1
     while @@FETCH_STATUS = 0
     BEGIN
       exec ('alter table '+@reftable_1+' drop constraint '+@constraintname_1)
       FETCH NEXT from refcursor into @reftable_1, @constraintname_1
     END
     CLOSE refcursor
     DEALLOCATE refcursor
     DROP TABLE COFFEES
END


CREATE TABLE COFFEES
(
    COFFEE_ID INT NOT NULL IDENTITY (1,1),
    COFFEE_NAME VARCHAR (50) NULL,
    SUPPLIER_ID INT NULL,
    PRICE FLOAT NULL,
    SALES INT NULL,
    TOTAL INT NULL,

    CONSTRAINT COFFEES_PK PRIMARY KEY(COFFEE_ID));

  \ No newline at end of file
  
  
  
  1.4       +20 -0     jakarta-jetspeed/src/sql/external/turbine-sybase.sql
  
  Index: turbine-sybase.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/sql/external/turbine-sybase.sql,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- turbine-sybase.sql	25 Feb 2002 04:15:43 -0000	1.3
  +++ turbine-sybase.sql	5 Dec 2002 20:00:07 -0000	1.4
  @@ -203,4 +203,24 @@
   );
   
   
  +/* ---------------------------------------------------------------------- */
  +/* COFFEES                                                      */
  +/* ---------------------------------------------------------------------- */
  +
  +IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'COFFEES')
  +BEGIN
  +    DROP TABLE COFFEES
  +END
  +;
  +
  +CREATE TABLE COFFEES
  +(
  +    COFFEE_ID INT NOT NULL,
  +    COFFEE_NAME VARCHAR (50) NULL,
  +    SUPPLIER_ID INT NULL,
  +    PRICE FLOAT NULL,
  +    SALES INT NULL,
  +    TOTAL INT NULL,
  +    CONSTRAINT COFFEES_PK PRIMARY KEY(COFFEE_ID)
  +);
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message