-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add seed_plan_zone table to oracle env (#39)
- Loading branch information
1 parent
827d957
commit 98a125e
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- THE.SEED_PLAN_ZONE definition | ||
|
||
-- DDL generated by DBeaver | ||
-- WARNING: It may differ from actual native database DDL | ||
|
||
-- Drop table | ||
|
||
-- DROP TABLE THE.SEED_PLAN_ZONE; | ||
|
||
CREATE TABLE THE.SEED_PLAN_ZONE ( | ||
SEED_PLAN_ZONE_ID NUMBER(10,0), | ||
GENETIC_CLASS_CODE VARCHAR2(1), | ||
SEED_PLAN_ZONE_CODE VARCHAR2(3), | ||
VEGETATION_CODE VARCHAR2(8), | ||
CONSTRAINT SPZS_PK PRIMARY KEY (SEED_PLAN_ZONE_ID), | ||
CONSTRAINT SYS_C0035427 CHECK ("SEED_PLAN_ZONE_ID" IS NOT NULL), | ||
CONSTRAINT SYS_C0035428 CHECK ("GENETIC_CLASS_CODE" IS NOT NULL), | ||
CONSTRAINT SYS_C0035429 CHECK ("SEED_PLAN_ZONE_CODE" IS NOT NULL) | ||
); | ||
CREATE INDEX SPZS_GCC_FK_I ON THE.SEED_PLAN_ZONE (GENETIC_CLASS_CODE); | ||
CREATE INDEX SPZS_SPZC1_FK_I ON THE.SEED_PLAN_ZONE (SEED_PLAN_ZONE_CODE); | ||
CREATE INDEX SPZS_VC_FK_I ON THE.SEED_PLAN_ZONE (VEGETATION_CODE); | ||
CREATE UNIQUE INDEX SPZ_BK_I ON THE.SEED_PLAN_ZONE (GENETIC_CLASS_CODE,SEED_PLAN_ZONE_CODE,VEGETATION_CODE); | ||
|
||
|
||
-- THE.SEED_PLAN_ZONE foreign keys | ||
|
||
ALTER TABLE THE.SEED_PLAN_ZONE ADD CONSTRAINT SPZS_GCC_FK FOREIGN KEY (GENETIC_CLASS_CODE) REFERENCES THE.GENETIC_CLASS_CODE(GENETIC_CLASS_CODE); | ||
ALTER TABLE THE.SEED_PLAN_ZONE ADD CONSTRAINT SPZS_SPZC1_FK FOREIGN KEY (SEED_PLAN_ZONE_CODE) REFERENCES THE.SEED_PLAN_ZONE_CODE(SEED_PLAN_ZONE_CODE); | ||
ALTER TABLE THE.SEED_PLAN_ZONE ADD CONSTRAINT SPZS_VC_FK FOREIGN KEY (VEGETATION_CODE) REFERENCES THE.VEGETATION_CODE(VEGETATION_CODE); |