Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add seed_plan_zone table to oracle env #39

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Loading