Skip to content

Commit

Permalink
fix: add seed_plan_zone table to oracle env (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
franTarkenton authored Nov 26, 2024
1 parent 827d957 commit 98a125e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions migrations_ora/sql/V1.8.0__seed_plan_zone.sql
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);

0 comments on commit 98a125e

Please sign in to comment.