db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r278730 - in /incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity: schema.sql schema1.sql schema2.sql schema3.sql schema4.sql
Date Mon, 05 Sep 2005 12:47:26 GMT
Author: mbo
Date: Mon Sep  5 05:47:20 2005
New Revision: 278730

URL: http://svn.apache.org/viewcvs?rev=278730&view=rev
Log:
Fixed foreign key definitions in join tables for many-to-many relationships 
in datastore identity schema. Changes provided by Andy Jefferson.

Modified:
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema1.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema2.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema3.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema4.sql

Modified: incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql?rev=278730&r1=278729&r2=278730&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql Mon Sep  5 05:47:20
2005
@@ -155,8 +155,8 @@
 );
 
 CREATE TABLE project_member (
-    PROJID INTEGER REFERENCES projects NOT NULL,
-    MEMBER INTEGER REFERENCES persons NOT NULL
+    PROJID INTEGER NOT NULL,
+    MEMBER INTEGER NOT NULL
 );
 
 CREATE TABLE employee_phoneno_type (
@@ -167,15 +167,23 @@
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
-        (PROJID) REFERENCES projects(PROJID);
+        (PROJID) REFERENCES projects;
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_REV_FK FOREIGN KEY
-        (REVIEWER) REFERENCES persons(PERSONID);
+        (REVIEWER) REFERENCES persons;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY
+        (MEMBER) REFERENCES persons;
 
 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
-        (EMP_OF_THE_MONTH) REFERENCES persons(DATASTORE_IDENTITY);
+        (EMP_OF_THE_MONTH) REFERENCES persons;
 
 -------------------------
 --fieldtypes
@@ -7108,8 +7116,8 @@
     INT_H INTEGER,
     DISCRIMINATOR varchar(64) NOT NULL,
     CONSTRAINT AllPersist_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    FOREIGN KEY (SECOND_OBJ) REFERENCES AllPersist (DATASTORE_IDENTITY),
-    FOREIGN KEY (THIRD_OBJ) REFERENCES AllPersist (DATASTORE_IDENTITY)
+    FOREIGN KEY (SECOND_OBJ) REFERENCES AllPersist,
+    FOREIGN KEY (THIRD_OBJ) REFERENCES AllPersist
 );
 
 CREATE TABLE TopNonPersistB (
@@ -7124,8 +7132,8 @@
     INT_H INTEGER,
     DISCRIMINATOR varchar(64) NOT NULL,
     CONSTRAINT TopNonPersistB_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    FOREIGN KEY (SECOND_OBJ) REFERENCES TopNonPersistB (DATASTORE_IDENTITY),
-    FOREIGN KEY (THIRD_OBJ) REFERENCES TopNonPersistB (DATASTORE_IDENTITY)
+    FOREIGN KEY (SECOND_OBJ) REFERENCES TopNonPersistB,
+    FOREIGN KEY (THIRD_OBJ) REFERENCES TopNonPersistB
 );
 
 CREATE TABLE TopPersist (
@@ -7140,8 +7148,8 @@
     INT_H INTEGER,
     DISCRIMINATOR varchar(64) NOT NULL,
     CONSTRAINT TopPersist_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    FOREIGN KEY (SECOND_OBJ) REFERENCES TopPersist (DATASTORE_IDENTITY),
-    FOREIGN KEY (THIRD_OBJ) REFERENCES TopPersist (DATASTORE_IDENTITY)
+    FOREIGN KEY (SECOND_OBJ) REFERENCES TopPersist,
+    FOREIGN KEY (THIRD_OBJ) REFERENCES TopPersist
 );
 
 CREATE TABLE FieldSameName (
@@ -7156,8 +7164,8 @@
     FSN4_N3 INTEGER,
     DISCRIMINATOR varchar(64) NOT NULL,
     CONSTRAINT FieldSameName_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    FOREIGN KEY (FSN3_N2) REFERENCES FieldSameName (DATASTORE_IDENTITY),
-    FOREIGN KEY (FSN3_N3) REFERENCES FieldSameName (DATASTORE_IDENTITY)
+    FOREIGN KEY (FSN3_N2) REFERENCES FieldSameName,
+    FOREIGN KEY (FSN3_N3) REFERENCES FieldSameName
 );
 
 -------------------------

Modified: incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema1.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema1.sql?rev=278730&r1=278729&r2=278730&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema1.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema1.sql Mon Sep  5 05:47:20
2005
@@ -134,8 +134,8 @@
 );
 
 CREATE TABLE project_member (
-    PROJID INTEGER REFERENCES projects NOT NULL,
-    MEMBER INTEGER REFERENCES persons NOT NULL
+    PROJID INTEGER NOT NULL,
+    MEMBER INTEGER NOT NULL
 );
 
 CREATE TABLE employee_phoneno_type (
@@ -146,11 +146,19 @@
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
-        (PROJID) REFERENCES projects(PROJID);
+        (PROJID) REFERENCES projects(DATASTORE_IDENTITY);
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_REV_FK FOREIGN KEY
-        (REVIEWER) REFERENCES persons(PERSONID);
+        (REVIEWER) REFERENCES persons(DATASTORE_IDENTITY);
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects(DATASTORE_IDENTITY);
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY
+        (MEMBER) REFERENCES persons(DATASTORE_IDENTITY);
 
 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY

Modified: incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema2.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema2.sql?rev=278730&r1=278729&r2=278730&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema2.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema2.sql Mon Sep  5 05:47:20
2005
@@ -159,8 +159,8 @@
 );
 
 CREATE TABLE project_member (
-    PROJID INTEGER REFERENCES projects NOT NULL,
-    MEMBER INTEGER REFERENCES fulltimeemployees NOT NULL
+    PROJID INTEGER NOT NULL,
+    MEMBER INTEGER NOT NULL
 );
 
 CREATE TABLE employee_phoneno_type (
@@ -183,14 +183,22 @@
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
-        (PROJID) REFERENCES projects(PROJID);
+        (PROJID) REFERENCES projects;
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_REV_FK FOREIGN KEY
-        (REVIEWER) REFERENCES fulltimeemployees(PERSONID);
+        (REVIEWER) REFERENCES fulltimeemployees;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY
+        (MEMBER) REFERENCES fulltimeemployees;
 
 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
-        (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees(DATASTORE_IDENTITY);
+        (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees;
 
 disconnect;

Modified: incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema3.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema3.sql?rev=278730&r1=278729&r2=278730&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema3.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema3.sql Mon Sep  5 05:47:20
2005
@@ -83,7 +83,7 @@
     HRADVISOR INTEGER REFERENCES persons,
     WAGE FLOAT,
     CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY)
+    CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons 
 );
 
 CREATE TABLE fulltimeemployees (
@@ -97,7 +97,7 @@
     HRADVISOR INTEGER REFERENCES persons,
     SALARY FLOAT,
     CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY)
+    CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons 
 );
 
 CREATE TABLE medicalinsurance (
@@ -132,8 +132,8 @@
 );
 
 CREATE TABLE project_member (
-    PROJID INTEGER REFERENCES projects NOT NULL,
-    MEMBER INTEGER REFERENCES persons NOT NULL
+    PROJID INTEGER NOT NULL,
+    MEMBER INTEGER NOT NULL
 );
 
 CREATE TABLE employee_phoneno_type (
@@ -144,14 +144,22 @@
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
-        (PROJID) REFERENCES projects(PROJID);
+        (PROJID) REFERENCES projects;
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_REV_FK FOREIGN KEY
-        (REVIEWER) REFERENCES persons(PERSONID);
+        (REVIEWER) REFERENCES persons;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY
+        (MEMBER) REFERENCES persons;
 
 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
-        (EMP_OF_THE_MONTH) REFERENCES persons(DATASTORE_IDENTITY);
+        (EMP_OF_THE_MONTH) REFERENCES persons;
 
 disconnect;

Modified: incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema4.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema4.sql?rev=278730&r1=278729&r2=278730&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema4.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema4.sql Mon Sep  5 05:47:20
2005
@@ -80,7 +80,7 @@
     SALARY FLOAT,
     DISCRIMINATOR varchar(64) NOT NULL,
     CONSTRAINT EMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY)
+    CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons
 );
 
 CREATE TABLE insuranceplans (
@@ -108,8 +108,8 @@
 );
 
 CREATE TABLE project_member (
-    PROJID INTEGER REFERENCES projects NOT NULL,
-    MEMBER INTEGER REFERENCES persons NOT NULL
+    PROJID INTEGER NOT NULL,
+    MEMBER INTEGER NOT NULL
 );
 
 CREATE TABLE employee_phoneno_type (
@@ -120,14 +120,22 @@
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
-        (PROJID) REFERENCES projects(PROJID);
+        (PROJID) REFERENCES projects;
 
 ALTER TABLE project_reviewer 
     ADD CONSTRAINT PR_REV_FK FOREIGN KEY
-        (REVIEWER) REFERENCES persons(PERSONID);
+        (REVIEWER) REFERENCES persons;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects;
+
+ALTER TABLE project_member 
+    ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY
+        (MEMBER) REFERENCES persons;
 
 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
-        (EMP_OF_THE_MONTH) REFERENCES persons(DATASTORE_IDENTITY);
+        (EMP_OF_THE_MONTH) REFERENCES persons;
 
 disconnect;



Mime
View raw message