db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [db-jdo] 23/43: JDO-375: adds names to the foreign key constraints for the company model in schema 0
Date Fri, 07 May 2021 23:12:05 GMT
This is an automated email from the ASF dual-hosted git repository.

clr pushed a commit to branch origin/2.0.1
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit 080336e43005e54d3df13254234bd6767e0e7e3d
Author: Michael Bouschen <mbo@apache.org>
AuthorDate: Mon May 1 16:05:30 2006 +0000

    JDO-375: adds names to the foreign key constraints for the company model in schema 0
---
 tck20/src/sql/derby/applicationidentity/schema.sql | 28 ++++++++++++++++------
 tck20/src/sql/derby/datastoreidentity/schema.sql   | 28 ++++++++++++++++------
 2 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/tck20/src/sql/derby/applicationidentity/schema.sql b/tck20/src/sql/derby/applicationidentity/schema.sql
index 5be13c8..63733a6 100644
--- a/tck20/src/sql/derby/applicationidentity/schema.sql
+++ b/tck20/src/sql/derby/applicationidentity/schema.sql
@@ -161,8 +161,15 @@ CREATE TABLE PCPointSingleFieldDate (
 -------------------------
 
 ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK;
 ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK;
 ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK;
+ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK;
 DROP TABLE insuranceplans;
 DROP TABLE project_reviewer;
 DROP TABLE project_member;
@@ -190,8 +197,9 @@ CREATE TABLE departments (
     ID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     EMP_OF_THE_MONTH INTEGER,
-    COMPANYID INTEGER REFERENCES companies,
+    COMPANYID INTEGER,
     DISCRIMINATOR VARCHAR(255),
+    CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies,
     CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
 );
 
@@ -209,14 +217,19 @@ CREATE TABLE persons (
     COUNTRY VARCHAR(64),
     HIREDATE VARCHAR(32),
     WEEKLYHOURS REAL,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES persons,
-    MENTOR INTEGER REFERENCES persons,
-    HRADVISOR INTEGER REFERENCES persons,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     SALARY REAL,
     WAGE REAL,
     DISCRIMINATOR varchar(64) NOT NULL,
+    CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments,
+    CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments,
+    CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons,
+    CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons,
+    CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons,
     CONSTRAINT EMPS_PK PRIMARY KEY (PERSONID)
 );
 
@@ -226,7 +239,8 @@ CREATE TABLE insuranceplans (
     LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
     PLANTYPE VARCHAR(8),
     DISCRIMINATOR varchar(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES persons,
+    EMPLOYEE INTEGER,
+    CONSTRAINT INS_EMP_FK FOREIGN KEY (EMPLOYEE) REFERENCES persons,
     CONSTRAINT INS_PK PRIMARY KEY (INSID)
 );
 
diff --git a/tck20/src/sql/derby/datastoreidentity/schema.sql b/tck20/src/sql/derby/datastoreidentity/schema.sql
index bdc376a..7cd19c1 100644
--- a/tck20/src/sql/derby/datastoreidentity/schema.sql
+++ b/tck20/src/sql/derby/datastoreidentity/schema.sql
@@ -108,8 +108,15 @@ CREATE TABLE NoExtent (
 -------------------------
 
 ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK;
 ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK;
 ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK;
+ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK;
+ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK;
 DROP TABLE insuranceplans;
 DROP TABLE project_reviewer;
 DROP TABLE project_member;
@@ -139,8 +146,9 @@ CREATE TABLE departments (
     ID INTEGER,
     NAME VARCHAR(32) NOT NULL,
     EMP_OF_THE_MONTH INTEGER,
-    COMPANYID INTEGER REFERENCES companies,
+    COMPANYID INTEGER,
     DISCRIMINATOR VARCHAR(255),
+    CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies,
     CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -159,14 +167,19 @@ CREATE TABLE persons (
     COUNTRY VARCHAR(64),
     HIREDATE VARCHAR(32),
     WEEKLYHOURS REAL,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES persons,
-    MENTOR INTEGER REFERENCES persons,
-    HRADVISOR INTEGER REFERENCES persons,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     SALARY REAL,
     WAGE REAL,
     DISCRIMINATOR varchar(64) NOT NULL,
+    CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments,
+    CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments,
+    CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons,
+    CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons,
+    CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons,
     CONSTRAINT PERS_UK UNIQUE (PERSONID),
     CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
@@ -178,7 +191,8 @@ CREATE TABLE insuranceplans (
     LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
     PLANTYPE VARCHAR(8),
     DISCRIMINATOR varchar(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES persons,
+    EMPLOYEE INTEGER,
+    CONSTRAINT INS_EMP_FK FOREIGN KEY (EMPLOYEE) REFERENCES persons,
     CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 

Mime
View raw message