diff --git a/backend/pom.xml b/backend/pom.xml index 4c69cd58..c6d3b09a 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -120,7 +120,7 @@ - + org.springframework.boot spring-boot-starter-web @@ -130,6 +130,7 @@ spring-boot-starter-validation + org.projectlombok lombok @@ -141,6 +142,11 @@ prettytime 5.0.9.Final + + org.apache.commons + commons-lang3 + 3.17.0 + diff --git a/backend/src/test/resources/application-default.yml b/backend/src/test/resources/application-default.yml index 9e9be1e6..67b39a04 100644 --- a/backend/src/test/resources/application-default.yml +++ b/backend/src/test/resources/application-default.yml @@ -1,7 +1,7 @@ spring: flyway: enabled: false -# FAM + # FAM security: oauth2: resourceserver: @@ -10,19 +10,25 @@ spring: jwk-set-uri: https://aws-cognito-issuer-uri.aws.com/.well-known/jwks.json # Users allowed to see and download WMS layers information -nr: - results: - config: - wms-layers: - whitelist: ${WMS_LAYERS_WHITELIST_USERS:NONE} - opening-search: - org-units: ${OPENING_SEARCH_ORG_UNITS:DCK} +ca: + bc: + gov: + nrs: + results: + wms-layers: + whitelist: ${WMS_LAYERS_WHITELIST_USERS:NONE} + opening-search: + org-units: ${OPENING_SEARCH_ORG_UNITS:DAS} + forest-client-api: + address: http://localhost:10000 + key: 123456789abcdef + open-maps: + address: http://localhost:10001 -# Forest Client API -#forest-client-api: -# address: https://nonexistent.org -# key: 123456789abcdef logging: level: - ca.bc.gov.restapi.results: ${LOGGING_LEVEL:INFO} \ No newline at end of file + #root: DEBUG + ca.bc.gov.restapi.results: ${LOGGING_LEVEL:INFO} + org.springframework.web.client: DEBUG + org.springframework.http.client: DEBUG \ No newline at end of file diff --git a/backend/src/test/resources/migration/oracle/V001__oracle_init.sql b/backend/src/test/resources/migration/oracle/V001__oracle_init.sql index b7628d26..6ebb03fb 100644 --- a/backend/src/test/resources/migration/oracle/V001__oracle_init.sql +++ b/backend/src/test/resources/migration/oracle/V001__oracle_init.sql @@ -1,3 +1,160 @@ +-- All the code tables required so far + +CREATE TABLE THE.OPEN_CATEGORY_CODE ( + OPEN_CATEGORY_CODE VARCHAR2(7), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT OCC_PK PRIMARY KEY (OPEN_CATEGORY_CODE), + CONSTRAINT SYS_C007655_OCC_CT CHECK ("OPEN_CATEGORY_CODE" IS NOT NULL), + CONSTRAINT SYS_C007656_OCC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C007657_OCC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C007658_OCC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C007659_OCC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.AGE_CLASS_CODE ( + AGE_CLASS_CODE VARCHAR2(1), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT ACC_PK PRIMARY KEY (AGE_CLASS_CODE), + CONSTRAINT SYS_C007687_ACC_CT CHECK ("AGE_CLASS_CODE" IS NOT NULL), + CONSTRAINT SYS_C007689_ACC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C007690_ACC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C007691_ACC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C007692_ACC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.HEIGHT_CLASS_CODE ( + HEIGHT_CLASS_CODE VARCHAR2(1), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT HCC_PK PRIMARY KEY (HEIGHT_CLASS_CODE), + CONSTRAINT SYS_C0039387_HCC_CT CHECK ("HEIGHT_CLASS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0039388_HCC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0039389_HCC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0039390_HCC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0039391_HCC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.OPENING_STATUS_CODE ( + OPENING_STATUS_CODE VARCHAR2(3), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT OSC_PK PRIMARY KEY (OPENING_STATUS_CODE), + CONSTRAINT SYS_C008336_OSC_CT CHECK ("OPENING_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C008337_OSC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C008338_OSC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C008339_OSC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C008340_OSC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.STOCKING_CLASS_CODE ( + STOCKING_CLASS_CODE VARCHAR2(1), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT SCC1_PK PRIMARY KEY (STOCKING_CLASS_CODE), + CONSTRAINT SYS_C008214_SCC1_CT CHECK ("STOCKING_CLASS_CODE" IS NOT NULL), + CONSTRAINT SYS_C008215_SCC1_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C008216_SCC1_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C008217_SCC1_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C008218_SCC1_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.SITE_CLASS_CODE ( + SITE_CLASS_CODE VARCHAR2(1), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT SITE_CLASS_CODE_PK PRIMARY KEY (SITE_CLASS_CODE), + CONSTRAINT SYS_C008260_SCC_CT CHECK ("SITE_CLASS_CODE" IS NOT NULL), + CONSTRAINT SYS_C008262_SCC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C008264_SCC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C008265_SCC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C008266_SCC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.SITE_INDEX_SOURCE_CODE ( + SITE_INDEX_SOURCE_CODE VARCHAR2(1), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT SISC_PK PRIMARY KEY (SITE_INDEX_SOURCE_CODE), + CONSTRAINT SYS_C008567_SISC_CT CHECK ("SITE_INDEX_SOURCE_CODE" IS NOT NULL), + CONSTRAINT SYS_C008569_SISC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C008571_SISC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C008572_SISC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C008573_SISC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.STOCKING_STATUS_CODE ( + STOCKING_STATUS_CODE VARCHAR2(3), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT SSC6_PK PRIMARY KEY (STOCKING_STATUS_CODE), + CONSTRAINT SYS_C007771_SSC6_CT CHECK ("STOCKING_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C007772_SSC6_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C007773_SSC6_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C007774_SSC6_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C007775_SSC6_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.TSB_NUMBER_CODE ( + TSB_NUMBER_CODE VARCHAR2(3), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT SYS_C0016369_TSBNC_CT CHECK ("TSB_NUMBER_CODE" IS NOT NULL), + CONSTRAINT SYS_C0016370_TSBNC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0016371_TSBNC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0016372_TSBNC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0016374_TSBNC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT TSBNC_PK PRIMARY KEY (TSB_NUMBER_CODE) +); + +CREATE TABLE THE.TREE_SPECIES_CODE ( + TREE_SPECIES_CODE VARCHAR2(3), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT SYS_C0031659_TSC_CT CHECK ("TREE_SPECIES_CODE" IS NOT NULL), + CONSTRAINT SYS_C0031660_TSC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0031661_TSC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0031662_TSC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0031663_TSC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT TSC_PK PRIMARY KEY (TREE_SPECIES_CODE) +); + +CREATE TABLE THE.RESULTS_AUDIT_ACTION_CODE ( + RESULTS_AUDIT_ACTION_CODE VARCHAR2(3), + DESCRIPTION VARCHAR2(120), + EFFECTIVE_DATE DATE, + EXPIRY_DATE DATE, + UPDATE_TIMESTAMP DATE, + CONSTRAINT RAAC_PK PRIMARY KEY (RESULTS_AUDIT_ACTION_CODE), + CONSTRAINT SYS_C007760_RAAC_CT CHECK ("RESULTS_AUDIT_ACTION_CODE" IS NOT NULL), + CONSTRAINT SYS_C007761_RAAC_CT CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C007762_RAAC_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C007763_RAAC_CT CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C007764_RAAC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); +-- Other domain tables + CREATE TABLE THE.CUT_BLOCK_OPEN_ADMIN ( CUT_BLOCK_OPEN_ADMIN_ID NUMBER(10,0), FOREST_FILE_ID VARCHAR2(10), @@ -23,12 +180,12 @@ CREATE TABLE THE.CUT_BLOCK_OPEN_ADMIN ( OPENING_PRIME_LICENCE_IND IN ('N', 'Y') ), CONSTRAINT CBOA_PK PRIMARY KEY (CUT_BLOCK_OPEN_ADMIN_ID), - CONSTRAINT SYS_C0021117 CHECK ("CUT_BLOCK_OPEN_ADMIN_ID" IS NOT NULL), - CONSTRAINT SYS_C0021119 CHECK ("REVISION_COUNT" IS NOT NULL), - CONSTRAINT SYS_C0021121 CHECK ("ENTRY_USERID" IS NOT NULL), - CONSTRAINT SYS_C0021123 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0021124 CHECK ("UPDATE_USERID" IS NOT NULL), - CONSTRAINT SYS_C0021125 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) + CONSTRAINT SYS_C0021117_CBOA_CT CHECK ("CUT_BLOCK_OPEN_ADMIN_ID" IS NOT NULL), + CONSTRAINT SYS_C0021119_CBOA_CT CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT SYS_C0021121_CBOA_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0021123_CBOA_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0021124_CBOA_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0021125_CBOA_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) ); CREATE INDEX CBOA_CBLK_FK_I ON THE.CUT_BLOCK_OPEN_ADMIN (CUT_BLOCK_ID,TIMBER_MARK,FOREST_FILE_ID); CREATE INDEX CBOA_CBSKEY_I ON THE.CUT_BLOCK_OPEN_ADMIN (CB_SKEY); @@ -36,20 +193,6 @@ CREATE INDEX CBOA_FFID_MARK_BLK_I ON THE.CUT_BLOCK_OPEN_ADMIN (FOREST_FILE_ID,TI CREATE INDEX CBOA_MARK_BLK_I ON THE.CUT_BLOCK_OPEN_ADMIN (TIMBER_MARK,CUT_BLOCK_ID); CREATE INDEX CBOA_O_FK_I ON THE.CUT_BLOCK_OPEN_ADMIN (OPENING_ID); -CREATE TABLE THE.OPEN_CATEGORY_CODE ( - OPEN_CATEGORY_CODE VARCHAR2(7), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, - UPDATE_TIMESTAMP DATE, - CONSTRAINT OCC_PK PRIMARY KEY (OPEN_CATEGORY_CODE), - CONSTRAINT SYS_C007655 CHECK ("OPEN_CATEGORY_CODE" IS NOT NULL), - CONSTRAINT SYS_C007656 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C007657 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C007658 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C007659 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) -); - CREATE TABLE THE.OPENING_ATTACHMENT ( OPENING_ATTACHMENT_FILE_ID NUMBER(10,0), OPENING_ID NUMBER(10,0), @@ -65,21 +208,20 @@ CREATE TABLE THE.OPENING_ATTACHMENT ( OPENING_ATTACHMENT_GUID RAW(16) DEFAULT sys_guid() , CONSTRAINT OPATT_GUID_UK UNIQUE (OPENING_ATTACHMENT_GUID), CONSTRAINT OPENING_ATTACHMENT_PK PRIMARY KEY (OPENING_ATTACHMENT_FILE_ID), - CONSTRAINT SYS_C00170771 CHECK ("OPENING_ATTACHMENT_GUID" IS NOT NULL), - CONSTRAINT SYS_C0040027 CHECK ("OPENING_ATTACHMENT_FILE_ID" IS NOT NULL), - CONSTRAINT SYS_C0040028 CHECK ("OPENING_ID" IS NOT NULL), - CONSTRAINT SYS_C0040029 CHECK ("ATTACHMENT_NAME" IS NOT NULL), - CONSTRAINT SYS_C0040030 CHECK ("ATTACHMENT_DATA" IS NOT NULL), - CONSTRAINT SYS_C0040031 CHECK ("ENTRY_USERID" IS NOT NULL), - CONSTRAINT SYS_C0040032 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0040033 CHECK ("UPDATE_USERID" IS NOT NULL), - CONSTRAINT SYS_C0040034 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0040035 CHECK ("REVISION_COUNT" IS NOT NULL) + CONSTRAINT SYS_C00170771_OPATT_CT CHECK ("OPENING_ATTACHMENT_GUID" IS NOT NULL), + CONSTRAINT SYS_C0040027_OPATT_CT CHECK ("OPENING_ATTACHMENT_FILE_ID" IS NOT NULL), + CONSTRAINT SYS_C0040028_OPATT_CT CHECK ("OPENING_ID" IS NOT NULL), + CONSTRAINT SYS_C0040029_OPATT_CT CHECK ("ATTACHMENT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0040030_OPATT_CT CHECK ("ATTACHMENT_DATA" IS NOT NULL), + CONSTRAINT SYS_C0040031_OPATT_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0040032_OPATT_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0040033_OPATT_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0040034_OPATT_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0040035_OPATT_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); CREATE INDEX OA_MTC_FK_I ON THE.OPENING_ATTACHMENT (MIME_TYPE_CODE); CREATE INDEX OA_O_FK_I ON THE.OPENING_ATTACHMENT (OPENING_ID); - CREATE TABLE THE.OPENING ( OPENING_ID NUMBER(10,0), GEO_DISTRICT_NO NUMBER(10,0), @@ -117,16 +259,16 @@ CREATE TABLE THE.OPENING ( UPDATE_TIMESTAMP DATE, REVISION_COUNT NUMBER(5,0), CONSTRAINT O_PK PRIMARY KEY (OPENING_ID), - CONSTRAINT SYS_C0039363 CHECK ("OPENING_ID" IS NOT NULL), - CONSTRAINT SYS_C0039364 CHECK ("GEO_DISTRICT_NO" IS NOT NULL), - CONSTRAINT SYS_C0039365 CHECK ("ADMIN_DISTRICT_NO" IS NOT NULL), - CONSTRAINT SYS_C0039366 CHECK ("OPEN_CATEGORY_CODE" IS NOT NULL), - CONSTRAINT SYS_C0039367 CHECK ("OPENING_STATUS_CODE" IS NOT NULL), - CONSTRAINT SYS_C0039368 CHECK ("ENTRY_USERID" IS NOT NULL), - CONSTRAINT SYS_C0039369 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0039370 CHECK ("UPDATE_USERID" IS NOT NULL), - CONSTRAINT SYS_C0039371 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0039372 CHECK ("REVISION_COUNT" IS NOT NULL) + CONSTRAINT SYS_C0039363_O_CT CHECK ("OPENING_ID" IS NOT NULL), + CONSTRAINT SYS_C0039364_O_CT CHECK ("GEO_DISTRICT_NO" IS NOT NULL), + CONSTRAINT SYS_C0039365_O_CT CHECK ("ADMIN_DISTRICT_NO" IS NOT NULL), + CONSTRAINT SYS_C0039366_O_CT CHECK ("OPEN_CATEGORY_CODE" IS NOT NULL), + CONSTRAINT SYS_C0039367_O_CT CHECK ("OPENING_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0039368_O_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0039369_O_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0039370_O_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0039371_O_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0039372_O_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); CREATE INDEX O_LICENSEE_ID_I ON THE.OPENING (LICENSEE_OPENING_ID); CREATE INDEX O_OPENING_NUMBER_I ON THE.OPENING (MAPSHEET_GRID,MAPSHEET_LETTER,MAPSHEET_QUAD,MAPSHEET_SQUARE,MAPSHEET_SUB_QUAD,OPENING_NUMBER); @@ -134,7 +276,6 @@ CREATE INDEX O_OPEN_CATEGORY_CODE_I ON THE.OPENING (OPEN_CATEGORY_CODE); CREATE INDEX O_OU_FK_I ON THE.OPENING (ADMIN_DISTRICT_NO); CREATE INDEX O_STATUS_I ON THE.OPENING (OPENING_STATUS_CODE); - CREATE TABLE THE.ORG_UNIT ( ORG_UNIT_NO NUMBER(10,0), ORG_UNIT_CODE VARCHAR2(6), @@ -152,20 +293,20 @@ CREATE TABLE THE.ORG_UNIT ( EXPIRY_DATE DATE, UPDATE_TIMESTAMP DATE, CONSTRAINT ORG_UNIT_PK PRIMARY KEY (ORG_UNIT_NO), - CONSTRAINT SYS_C0035144 CHECK ("ORG_UNIT_NO" IS NOT NULL), - CONSTRAINT SYS_C0035146 CHECK ("ORG_UNIT_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035148 CHECK ("ORG_UNIT_NAME" IS NOT NULL), - CONSTRAINT SYS_C0035150 CHECK ("LOCATION_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035152 CHECK ("AREA_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035154 CHECK ("TELEPHONE_NO" IS NOT NULL), - CONSTRAINT SYS_C0035156 CHECK ("ORG_LEVEL_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035158 CHECK ("OFFICE_NAME_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035160 CHECK ("ROLLUP_REGION_NO" IS NOT NULL), - CONSTRAINT SYS_C0035162 CHECK ("ROLLUP_REGION_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035164 CHECK ("ROLLUP_DIST_NO" IS NOT NULL), - CONSTRAINT SYS_C0035166 CHECK ("ROLLUP_DIST_CODE" IS NOT NULL), - CONSTRAINT SYS_C0035168 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C0035169 CHECK ("EXPIRY_DATE" IS NOT NULL) + CONSTRAINT SYS_C0035144_OU_CT CHECK ("ORG_UNIT_NO" IS NOT NULL), + CONSTRAINT SYS_C0035146_OU_CT CHECK ("ORG_UNIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035148_OU_CT CHECK ("ORG_UNIT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0035150_OU_CT CHECK ("LOCATION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035152_OU_CT CHECK ("AREA_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035154_OU_CT CHECK ("TELEPHONE_NO" IS NOT NULL), + CONSTRAINT SYS_C0035156_OU_CT CHECK ("ORG_LEVEL_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035158_OU_CT CHECK ("OFFICE_NAME_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035160_OU_CT CHECK ("ROLLUP_REGION_NO" IS NOT NULL), + CONSTRAINT SYS_C0035162_OU_CT CHECK ("ROLLUP_REGION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035164_OU_CT CHECK ("ROLLUP_DIST_NO" IS NOT NULL), + CONSTRAINT SYS_C0035166_OU_CT CHECK ("ROLLUP_DIST_CODE" IS NOT NULL), + CONSTRAINT SYS_C0035168_OU_CT CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0035169_OU_CT CHECK ("EXPIRY_DATE" IS NOT NULL) ); CREATE UNIQUE INDEX "I2$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_CODE,ORG_UNIT_NO); CREATE UNIQUE INDEX "I3$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_CODE); @@ -176,7 +317,6 @@ CREATE INDEX "I7$_ORG_UNIT" ON THE.ORG_UNIT (ROLLUP_REGION_CODE,ROLLUP_DIST_CODE CREATE UNIQUE INDEX "I8$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_NO,ORG_UNIT_CODE); CREATE UNIQUE INDEX "I9$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_CODE,ORG_LEVEL_CODE,ORG_UNIT_NO,ORG_UNIT_NAME); - CREATE TABLE THE.RESULTS_ELECTRONIC_SUBMISSION ( RESULTS_SUBMISSION_ID NUMBER(10,0), SUBMISSION_TIMESTAMP DATE, @@ -192,56 +332,14 @@ CREATE TABLE THE.RESULTS_ELECTRONIC_SUBMISSION ( UPDATE_TIMESTAMP DATE, REVISION_COUNT NUMBER(5,0), CONSTRAINT RES_PK PRIMARY KEY (RESULTS_SUBMISSION_ID), - CONSTRAINT SYS_C008001 CHECK ("RESULTS_SUBMISSION_ID" IS NOT NULL), - CONSTRAINT SYS_C008002 CHECK ("SUBMISSION_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C008003 CHECK ("SUBMITTED_BY" IS NOT NULL), - CONSTRAINT SYS_C008004 CHECK ("ENTRY_USERID" IS NOT NULL), - CONSTRAINT SYS_C008005 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C008006 CHECK ("UPDATE_USERID" IS NOT NULL), - CONSTRAINT SYS_C008007 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C008008 CHECK ("REVISION_COUNT" IS NOT NULL) -); - -CREATE TABLE THE.AGE_CLASS_CODE ( - AGE_CLASS_CODE VARCHAR2(1), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, - UPDATE_TIMESTAMP DATE, - CONSTRAINT ACC_PK PRIMARY KEY (AGE_CLASS_CODE), - CONSTRAINT SYS_C007687 CHECK ("AGE_CLASS_CODE" IS NOT NULL), - CONSTRAINT SYS_C007689 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C007690 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C007691 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C007692 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) -); - -CREATE TABLE THE.HEIGHT_CLASS_CODE ( - HEIGHT_CLASS_CODE VARCHAR2(1), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, - UPDATE_TIMESTAMP DATE, - CONSTRAINT HCC_PK PRIMARY KEY (HEIGHT_CLASS_CODE), - CONSTRAINT SYS_C0039387 CHECK ("HEIGHT_CLASS_CODE" IS NOT NULL), - CONSTRAINT SYS_C0039388 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C0039389 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C0039390 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C0039391 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) -); - -CREATE TABLE THE.OPENING_STATUS_CODE ( - OPENING_STATUS_CODE VARCHAR2(3), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, - UPDATE_TIMESTAMP DATE, - CONSTRAINT OSC_PK PRIMARY KEY (OPENING_STATUS_CODE), - CONSTRAINT SYS_C008336 CHECK ("OPENING_STATUS_CODE" IS NOT NULL), - CONSTRAINT SYS_C008337 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C008338 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C008339 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C008340 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) + CONSTRAINT SYS_C008001_RES_CT CHECK ("RESULTS_SUBMISSION_ID" IS NOT NULL), + CONSTRAINT SYS_C008002_RES_CT CHECK ("SUBMISSION_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C008003_RES_CT CHECK ("SUBMITTED_BY" IS NOT NULL), + CONSTRAINT SYS_C008004_RES_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C008005_RES_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C008006_RES_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C008007_RES_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C008008_RES_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); CREATE TABLE THE.SILV_ADMIN_ZONE ( @@ -250,96 +348,275 @@ CREATE TABLE THE.SILV_ADMIN_ZONE ( ADMIN_ZONE_DESC VARCHAR2(50), REVISION_COUNT NUMBER(5,0), CONSTRAINT SILV_ADMIN_ZONE_PK PRIMARY KEY (ORG_UNIT_NO,DIST_ADMIN_ZONE), - CONSTRAINT SYS_C007705 CHECK ("DIST_ADMIN_ZONE" IS NOT NULL), - CONSTRAINT SYS_C007706 CHECK ("ORG_UNIT_NO" IS NOT NULL), - CONSTRAINT SYS_C007707 CHECK ("ADMIN_ZONE_DESC" IS NOT NULL), - CONSTRAINT SYS_C007708 CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT SYS_C007705_SAZ_CT CHECK ("DIST_ADMIN_ZONE" IS NOT NULL), + CONSTRAINT SYS_C007706_SAZ_CT CHECK ("ORG_UNIT_NO" IS NOT NULL), + CONSTRAINT SYS_C007707_SAZ_CT CHECK ("ADMIN_ZONE_DESC" IS NOT NULL), + CONSTRAINT SYS_C007708_SAZ_CT CHECK ("REVISION_COUNT" IS NOT NULL), CONSTRAINT SAZ_OU_FK FOREIGN KEY (ORG_UNIT_NO) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO) ); -CREATE TABLE THE.STOCKING_CLASS_CODE ( - STOCKING_CLASS_CODE VARCHAR2(1), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, +CREATE TABLE THE.OPENING_AMENDMENT_HISTORY ( + OPENING_ID NUMBER(10,0), + OPENING_AMENDMENT_NUMBER NUMBER(5,0), + AMENDMENT_USERID VARCHAR2(30), + AMENDMENT_DATE DATE, + SUBMITTED_BY_USERID VARCHAR2(30), + SUBMITTED_DATE DATE, + APP_ENT_BY_USERID VARCHAR2(30), + APPROVE_DATE DATE, + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + UPDATE_USERID VARCHAR2(30), UPDATE_TIMESTAMP DATE, - CONSTRAINT SCC1_PK PRIMARY KEY (STOCKING_CLASS_CODE), - CONSTRAINT SYS_C008214 CHECK ("STOCKING_CLASS_CODE" IS NOT NULL), - CONSTRAINT SYS_C008215 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C008216 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C008217 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C008218 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) + REVISION_COUNT NUMBER(5,0), + CONSTRAINT OAH_PK PRIMARY KEY (OPENING_ID,OPENING_AMENDMENT_NUMBER), + CONSTRAINT SYS_C0026176_OAH_CT CHECK ("OPENING_ID" IS NOT NULL), + CONSTRAINT SYS_C0026178_OAH_CT CHECK ("OPENING_AMENDMENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0026181_OAH_CT CHECK ("AMENDMENT_USERID" IS NOT NULL), + CONSTRAINT SYS_C0026184_OAH_CT CHECK ("AMENDMENT_DATE" IS NOT NULL), + CONSTRAINT SYS_C0026187_OAH_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0026190_OAH_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0026193_OAH_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0026196_OAH_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0026199_OAH_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); -CREATE TABLE THE.SITE_CLASS_CODE ( - SITE_CLASS_CODE VARCHAR2(1), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, - UPDATE_TIMESTAMP DATE, - CONSTRAINT SITE_CLASS_CODE_PK PRIMARY KEY (SITE_CLASS_CODE), - CONSTRAINT SYS_C008260 CHECK ("SITE_CLASS_CODE" IS NOT NULL), - CONSTRAINT SYS_C008262 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C008264 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C008265 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C008266 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +CREATE TABLE THE.STOCKING_EVENT_HISTORY ( + STOCKING_EVENT_HISTORY_ID NUMBER(10,0), + OPENING_ID NUMBER(10,0), + OPENING_AMENDMENT_ID NUMBER(10,0), + OPENING_AMENDMENT_NUMBER NUMBER(5,0), + RESULTS_AUDIT_ACTION_CODE VARCHAR2(3), + SUBMITTED_USERID VARCHAR2(30), + RESULTS_SUBMISSION_ID NUMBER(10,0), + AMEND_EVENT_TIMESTAMP DATE, + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + REVISION_COUNT NUMBER(5,0), + CONSTRAINT SEH_PK PRIMARY KEY (STOCKING_EVENT_HISTORY_ID), + CONSTRAINT SYS_C0016112_SEH_CT CHECK ("STOCKING_EVENT_HISTORY_ID" IS NOT NULL), + CONSTRAINT SYS_C0016113_SEH_CT CHECK ("OPENING_ID" IS NOT NULL), + CONSTRAINT SYS_C0016114_SEH_CT CHECK ("RESULTS_AUDIT_ACTION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0016115_SEH_CT CHECK ("AMEND_EVENT_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0016116_SEH_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0016117_SEH_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0016118_SEH_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); +CREATE INDEX SEH_OAH_FK_I ON THE.STOCKING_EVENT_HISTORY (OPENING_AMENDMENT_ID,OPENING_AMENDMENT_NUMBER); +CREATE INDEX SEH_O_FK_I ON THE.STOCKING_EVENT_HISTORY (OPENING_ID); -CREATE TABLE THE.SITE_INDEX_SOURCE_CODE ( - SITE_INDEX_SOURCE_CODE VARCHAR2(1), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, +CREATE TABLE THE.RESULTS_AUDIT_EVENT ( + RESULTS_AUDIT_EVENT_ID NUMBER(10,0), + OPENING_ID NUMBER(10,0), + STANDARDS_REGIME_ID NUMBER(10,0), + SILVICULTURE_PROJECT_ID NUMBER(10,0), + RESULTS_AUDIT_ACTION_CODE VARCHAR2(3), + ACTION_DATE DATE, + DESCRIPTION VARCHAR2(2000), + USER_ID VARCHAR2(30), + EMAIL_SENT_IND VARCHAR2(1), + XML_SUBMISSION_ID NUMBER(10,0), + OPENING_AMENDMENT_NUMBER NUMBER(5,0), + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + CONSTRAINT RAE_PK PRIMARY KEY (RESULTS_AUDIT_EVENT_ID), + CONSTRAINT SYS_C0026137_RAE_CT CHECK ("RESULTS_AUDIT_EVENT_ID" IS NOT NULL), + CONSTRAINT SYS_C0026138_RAE_CT CHECK ("RESULTS_AUDIT_ACTION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0026139_RAE_CT CHECK ("ACTION_DATE" IS NOT NULL), + CONSTRAINT SYS_C0026140_RAE_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0026141_RAE_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT RAE_RAAC_FK FOREIGN KEY (RESULTS_AUDIT_ACTION_CODE) REFERENCES THE.RESULTS_AUDIT_ACTION_CODE(RESULTS_AUDIT_ACTION_CODE) +); + +CREATE TABLE THE.ACTIVITY_TREATMENT_UNIT ( + ACTIVITY_TREATMENT_UNIT_ID NUMBER(10,0), + ACTIVITY_TU_SEQ_NO NUMBER(5,0), + ORG_UNIT_NO NUMBER(10,0), + OPENING_ID NUMBER(10,0), + SILVICULTURE_PROJECT_ID NUMBER(10,0), + PROJECT_UNIT_ID NUMBER(6,0), + SILV_BASE_CODE VARCHAR2(2), + SILV_TECHNIQUE_CODE VARCHAR2(2), + SILV_METHOD_CODE VARCHAR2(5), + SILV_OBJECTIVE_CODE_1 VARCHAR2(3), + SILV_OBJECTIVE_CODE_2 VARCHAR2(3), + SILV_OBJECTIVE_CODE_3 VARCHAR2(3), + SILV_FUND_SRCE_CODE VARCHAR2(3), + SILV_ACTIVITY_MEASUREMENT_CODE VARCHAR2(3), + ACTIVITY_LICENSEE_ID VARCHAR2(30), + TREATMENT_AMOUNT NUMBER(11,1), + ACTUAL_TREATMENT_COST NUMBER(9,0), + ACT_PLANTED_NO NUMBER(10,0), + PLAN_SILV_TECHNIQUE_CODE VARCHAR2(2), + PLAN_SILV_METHOD_CODE VARCHAR2(5), + PLAN_SILV_FUND_SRCE_CODE VARCHAR2(3), + PLANNED_DATE DATE, + PLANNED_TREATMENT_AMOUNT NUMBER(11,1), + PLANNED_TREATMENT_COST NUMBER(9,0), + PLAN_SILV_OBJECTIVE_CODE_1 VARCHAR2(3), + PLAN_SILV_OBJECTIVE_CODE_2 VARCHAR2(3), + PLAN_SILV_OBJECTIVE_CODE_3 VARCHAR2(3), + TARGET_PREPARED_SPOTS NUMBER(4,0), + PRUNING_MIN_CROWN_PCT NUMBER(3,0), + PRUNE_HEIGHT NUMBER(3,1), + STEMS_TO_PRUNE NUMBER(4,0), + MIN_ACCEPTABLE_DENSITY NUMBER(4,0), + TOTAL_STEMS_PER_HA NUMBER(4,0), + INTER_TREE_TARGET_DISTANCE NUMBER(3,1), + INTER_TREE_VARIATION NUMBER(3,1), + INTER_TREE_MIN_DISTANCE NUMBER(3,1), + MAX_TREES_PER_PLOT NUMBER(2,0), + MAX_TREES_PER_HA NUMBER(4,0), + SURVEY_PLANNED_NUM_PLOTS NUMBER(4,0), + SURVEY_ACTUAL_NUM_PLOTS NUMBER(4,0), + SURVEY_MIN_PLOTS_PER_STRATUM NUMBER(10,0), + SILV_TREE_SPECIES_CODE VARCHAR2(8), + ATU_START_DATE DATE, + ATU_COMPLETION_DATE DATE, + RESULTS_IND VARCHAR2(1), + UNIT_BID_PRICE NUMBER(9,2), + FIA_PROJECT_ID VARCHAR2(10), + RESULTS_SUBMISSION_ID NUMBER(10,0), + DISTURBANCE_CODE VARCHAR2(3), + SILV_SYSTEM_CODE VARCHAR2(5), + SILV_SYSTEM_VARIANT_CODE VARCHAR2(3), + SILV_CUT_PHASE_CODE VARCHAR2(5), + CUT_BLOCK_OPEN_ADMIN_ID NUMBER(10,0), + DISTURBANCE_COMPLETED_IND VARCHAR2(1), + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + UPDATE_USERID VARCHAR2(30), UPDATE_TIMESTAMP DATE, - CONSTRAINT SISC_PK PRIMARY KEY (SITE_INDEX_SOURCE_CODE), - CONSTRAINT SYS_C008567 CHECK ("SITE_INDEX_SOURCE_CODE" IS NOT NULL), - CONSTRAINT SYS_C008569 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C008571 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C008572 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C008573 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) + REVISION_COUNT NUMBER(5,0), + CONSTRAINT ATU_PK PRIMARY KEY (ACTIVITY_TREATMENT_UNIT_ID), + CONSTRAINT SYS_C0039733_ATU_CT CHECK ("ACTIVITY_TREATMENT_UNIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0039734_ATU_CT CHECK ("ACTIVITY_TU_SEQ_NO" IS NOT NULL), + CONSTRAINT SYS_C0039735_ATU_CT CHECK ("ORG_UNIT_NO" IS NOT NULL), + CONSTRAINT SYS_C0039736_ATU_CT CHECK ("OPENING_ID" IS NOT NULL), + CONSTRAINT SYS_C0039737_ATU_CT CHECK ("SILV_BASE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0039738_ATU_CT CHECK ("SILV_ACTIVITY_MEASUREMENT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0039739_ATU_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0039740_ATU_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0039741_ATU_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0039742_ATU_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0039743_ATU_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); +CREATE INDEX ATU_ATU_I ON THE.ACTIVITY_TREATMENT_UNIT (OPENING_ID,SILV_BASE_CODE,SILV_METHOD_CODE,SILV_TECHNIQUE_CODE,TREATMENT_AMOUNT); +CREATE INDEX ATU_BASE_I ON THE.ACTIVITY_TREATMENT_UNIT (SILV_BASE_CODE,RESULTS_IND); +CREATE INDEX ATU_CBOA_FK_I ON THE.ACTIVITY_TREATMENT_UNIT (CUT_BLOCK_OPEN_ADMIN_ID); +CREATE INDEX ATU_LICENSEE_I ON THE.ACTIVITY_TREATMENT_UNIT (ACTIVITY_LICENSEE_ID); +CREATE INDEX ATU_O_FK_I ON THE.ACTIVITY_TREATMENT_UNIT (OPENING_ID); +CREATE INDEX ATU_PROJECT_I ON THE.ACTIVITY_TREATMENT_UNIT (FIA_PROJECT_ID,RESULTS_IND); +CREATE INDEX ATU_PROJ_FK_I ON THE.ACTIVITY_TREATMENT_UNIT (SILVICULTURE_PROJECT_ID); -CREATE TABLE THE.STOCKING_STATUS_CODE ( - STOCKING_STATUS_CODE VARCHAR2(3), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, +CREATE TABLE THE.SILV_RELIEF_APPLICATION ( + SILV_RELIEF_APPLICATION_ID NUMBER(10,0), + SILV_RELIEF_APPLICATION_NO NUMBER(3,0), + ACTIVITY_TREATMENT_UNIT_ID NUMBER(10,0), + SILV_RELIEF_APPL_STATUS_CODE VARCHAR2(3), + PRE_EVENT_FOREST_COVER_DATE DATE, + POST_EVENT_FOREST_COVER_DATE DATE, + AMENDMENT_OPENING_ID NUMBER(10,0), + OPENING_AMENDMENT_NUMBER NUMBER(5,0), + OBLIGATION_RELIEF_IND VARCHAR2(1), + OBLIGATION_MET_IND VARCHAR2(1), + CAUSE_DAMAGE_IND VARCHAR2(1), + OFFICIALLY_INDUCED_ERROR_IND VARCHAR2(1), + DUE_DILIGENCE_IND VARCHAR2(1), + AUTHORIZATION_CHECKED_IND VARCHAR2(1), + SUBMITTED_DATE DATE, + SUBMITTED_BY_USERID VARCHAR2(30), + APPROVED_DATE DATE, + APPROVED_BY_USERID VARCHAR2(30), + REJECT_COMMENT VARCHAR2(2000), + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + UPDATE_USERID VARCHAR2(30), UPDATE_TIMESTAMP DATE, - CONSTRAINT SSC6_PK PRIMARY KEY (STOCKING_STATUS_CODE), - CONSTRAINT SYS_C007771 CHECK ("STOCKING_STATUS_CODE" IS NOT NULL), - CONSTRAINT SYS_C007772 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C007773 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C007774 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C007775 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) + REVISION_COUNT NUMBER(5,0), + CONSTRAINT SRA_PK PRIMARY KEY (SILV_RELIEF_APPLICATION_ID), + CONSTRAINT SYS_C0030824_SRA_CT CHECK ("SILV_RELIEF_APPLICATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0030825_SRA_CT CHECK ("SILV_RELIEF_APPLICATION_NO" IS NOT NULL), + CONSTRAINT SYS_C0030826_SRA_CT CHECK ("ACTIVITY_TREATMENT_UNIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0030827_SRA_CT CHECK ("SILV_RELIEF_APPL_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0030828_SRA_CT CHECK ("PRE_EVENT_FOREST_COVER_DATE" IS NOT NULL), + CONSTRAINT SYS_C0030829_SRA_CT CHECK ("POST_EVENT_FOREST_COVER_DATE" IS NOT NULL), + CONSTRAINT SYS_C0030830_SRA_CT CHECK ("OBLIGATION_RELIEF_IND" IS NOT NULL), + CONSTRAINT SYS_C0030831_SRA_CT CHECK ("OBLIGATION_MET_IND" IS NOT NULL), + CONSTRAINT SYS_C0030832_SRA_CT CHECK ("CAUSE_DAMAGE_IND" IS NOT NULL), + CONSTRAINT SYS_C0030833_SRA_CT CHECK ("OFFICIALLY_INDUCED_ERROR_IND" IS NOT NULL), + CONSTRAINT SYS_C0030834_SRA_CT CHECK ("DUE_DILIGENCE_IND" IS NOT NULL), + CONSTRAINT SYS_C0030835_SRA_CT CHECK ("AUTHORIZATION_CHECKED_IND" IS NOT NULL), + CONSTRAINT SYS_C0030836_SRA_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0030837_SRA_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0030838_SRA_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0030839_SRA_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0030840_SRA_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); +CREATE INDEX SRA_ATU_FK_I ON THE.SILV_RELIEF_APPLICATION (ACTIVITY_TREATMENT_UNIT_ID); +CREATE INDEX SRA_OAH_FK_I ON THE.SILV_RELIEF_APPLICATION (AMENDMENT_OPENING_ID,OPENING_AMENDMENT_NUMBER); +CREATE INDEX SRA_SRASCD_FK_I ON THE.SILV_RELIEF_APPLICATION (SILV_RELIEF_APPL_STATUS_CODE); -CREATE TABLE THE.TSB_NUMBER_CODE ( - TSB_NUMBER_CODE VARCHAR2(3), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, +CREATE TABLE THE.STOCKING_STANDARD_UNIT ( + STOCKING_STANDARD_UNIT_ID NUMBER(10,0), + OPENING_ID NUMBER(10,0), + STANDARDS_UNIT_ID VARCHAR2(4), + STANDARDS_REGIME_ID NUMBER(10,0), + NET_AREA NUMBER(7,1), + MAX_ALLOW_SOIL_DISTURBANCE_PCT NUMBER(3,1), + VARIANCE_IND VARCHAR2(1), + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + UPDATE_USERID VARCHAR2(30), UPDATE_TIMESTAMP DATE, - CONSTRAINT SYS_C0016369 CHECK ("TSB_NUMBER_CODE" IS NOT NULL), - CONSTRAINT SYS_C0016370 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C0016371 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C0016372 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C0016374 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), - CONSTRAINT TSBNC_PK PRIMARY KEY (TSB_NUMBER_CODE) + REVISION_COUNT NUMBER(5,0), + CONSTRAINT SSU_PK PRIMARY KEY (STOCKING_STANDARD_UNIT_ID), + CONSTRAINT SYS_C0030763_SSU_CT CHECK ("STOCKING_STANDARD_UNIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0030764_SSU_CT CHECK ("OPENING_ID" IS NOT NULL), + CONSTRAINT SYS_C0030765_SSU_CT CHECK ("STANDARDS_UNIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0030767_SSU_CT CHECK ("NET_AREA" IS NOT NULL), + CONSTRAINT SYS_C0030769_SSU_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0030771_SSU_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0030773_SSU_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0030775_SSU_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0030776_SSU_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); +CREATE INDEX SSU_O_FK_I ON THE.STOCKING_STANDARD_UNIT (OPENING_ID); +CREATE INDEX SSU_SR_FK_I ON THE.STOCKING_STANDARD_UNIT (STANDARDS_REGIME_ID); +CREATE INDEX SSU_SU_I ON THE.STOCKING_STANDARD_UNIT (OPENING_ID,STANDARDS_UNIT_ID); -CREATE TABLE THE.TREE_SPECIES_CODE ( - TREE_SPECIES_CODE VARCHAR2(3), - DESCRIPTION VARCHAR2(120), - EFFECTIVE_DATE DATE, - EXPIRY_DATE DATE, +CREATE TABLE THE.STOCKING_MILESTONE ( + STOCKING_STANDARD_UNIT_ID NUMBER(10,0), + SILV_MILESTONE_TYPE_CODE VARCHAR2(3), + RESULTS_SUBMISSION_ID NUMBER(10,0), + DECLARED_DATE DATE, + DECLARED_USERID VARCHAR2(30), + DECLARE_IND VARCHAR2(1), + DECLARATION_SUBMITTED_DATE DATE, + EARLY_OFFSET_YEARS NUMBER(2,0), + LATE_OFFSET_YEARS NUMBER(2,0), + DUE_EARLY_DATE DATE, + DUE_LATE_DATE DATE, + ENTRY_USERID VARCHAR2(30), + ENTRY_TIMESTAMP DATE, + UPDATE_USERID VARCHAR2(30), UPDATE_TIMESTAMP DATE, - CONSTRAINT SYS_C0031659 CHECK ("TREE_SPECIES_CODE" IS NOT NULL), - CONSTRAINT SYS_C0031660 CHECK ("DESCRIPTION" IS NOT NULL), - CONSTRAINT SYS_C0031661 CHECK ("EFFECTIVE_DATE" IS NOT NULL), - CONSTRAINT SYS_C0031662 CHECK ("EXPIRY_DATE" IS NOT NULL), - CONSTRAINT SYS_C0031663 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), - CONSTRAINT TSC_PK PRIMARY KEY (TREE_SPECIES_CODE) + REVISION_COUNT NUMBER(5,0), + EXTENT_FEASIBLE_DECLARED_IND VARCHAR2(1) DEFAULT 'N' , + CONSTRAINT SM_PK PRIMARY KEY (STOCKING_STANDARD_UNIT_ID,SILV_MILESTONE_TYPE_CODE), + CONSTRAINT SYS_C00140760_SM_CT CHECK ("EXTENT_FEASIBLE_DECLARED_IND" IS NOT NULL), + CONSTRAINT SYS_C0026482_SM_CT CHECK ("STOCKING_STANDARD_UNIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0026483_SM_CT CHECK ("SILV_MILESTONE_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0026484_SM_CT CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0026485_SM_CT CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0026486_SM_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0026487_SM_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0026488_SM_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); +CREATE INDEX SM_DED_I ON THE.STOCKING_MILESTONE (DUE_EARLY_DATE); +CREATE INDEX SM_DLD_I ON THE.STOCKING_MILESTONE (DUE_LATE_DATE); + +-- Foreign keys references. Some are commented due to the table not being onboarded yet or due to the table belonging to another application --- There is some FK references that are not properly identified in the model --- ALTER TABLE THE.CUT_BLOCK_OPEN_ADMIN ADD CONSTRAINT CBOA_CB_FK FOREIGN KEY (CB_SKEY) REFERENCES (); @@ -369,8 +646,48 @@ ALTER TABLE THE.OPENING ADD CONSTRAINT O_TSC2_FK FOREIGN KEY (PREV_TREE_SPP2_COD --ALTER TABLE THE.RESULTS_ELECTRONIC_SUBMISSION ADD CONSTRAINT RES_CN_FK FOREIGN KEY (CLIENT_NUMBER,CLIENT_LOCN_CODE) REFERENCES (); ALTER TABLE THE.RESULTS_ELECTRONIC_SUBMISSION ADD CONSTRAINT RES_OU_FK FOREIGN KEY (ORG_UNIT_NO) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.STOCKING_EVENT_HISTORY ADD CONSTRAINT SEH_OAH_FK FOREIGN KEY (OPENING_AMENDMENT_ID,OPENING_AMENDMENT_NUMBER) REFERENCES THE.OPENING_AMENDMENT_HISTORY(OPENING_ID,OPENING_AMENDMENT_NUMBER); +ALTER TABLE THE.STOCKING_EVENT_HISTORY ADD CONSTRAINT SEH_O_FK FOREIGN KEY (OPENING_ID) REFERENCES THE.OPENING(OPENING_ID); +ALTER TABLE THE.STOCKING_EVENT_HISTORY ADD CONSTRAINT SEH_RAAC_FK FOREIGN KEY (RESULTS_AUDIT_ACTION_CODE) REFERENCES THE.RESULTS_AUDIT_ACTION_CODE(RESULTS_AUDIT_ACTION_CODE); + + +ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_CBOA_FK FOREIGN KEY (CUT_BLOCK_OPEN_ADMIN_ID) REFERENCES THE.CUT_BLOCK_OPEN_ADMIN(CUT_BLOCK_OPEN_ADMIN_ID); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_DC_FK FOREIGN KEY (DISTURBANCE_CODE) REFERENCES THE.DISTURBANCE_CODE(DISTURBANCE_CODE); +ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_OU_FK FOREIGN KEY (ORG_UNIT_NO) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_O_FK FOREIGN KEY (OPENING_ID) REFERENCES THE.OPENING(OPENING_ID); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_PROJ_FK FOREIGN KEY (SILVICULTURE_PROJECT_ID) REFERENCES THE.SILVICULTURE_PROJECT(SILVICULTURE_PROJECT_ID); +ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_RES_FK FOREIGN KEY (RESULTS_SUBMISSION_ID) REFERENCES THE.RESULTS_ELECTRONIC_SUBMISSION(RESULTS_SUBMISSION_ID); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SAM_FK FOREIGN KEY (SILV_ACTIVITY_MEASUREMENT_CODE) REFERENCES THE.SILV_ACTIVITY_MEASUREMENT_CODE(SILV_ACTIVITY_MEASUREMENT_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SBC_FK FOREIGN KEY (SILV_BASE_CODE) REFERENCES THE.SILV_BASE_CODE(SILV_BASE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SCPC_FK FOREIGN KEY (SILV_CUT_PHASE_CODE) REFERENCES THE.SILV_CUT_PHASE_CODE(SILV_CUT_PHASE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SFSC_FK FOREIGN KEY (SILV_FUND_SRCE_CODE) REFERENCES THE.SILV_FUND_SRCE_CODE(SILV_FUND_SRCE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SFSC_PLND_FK FOREIGN KEY (PLAN_SILV_FUND_SRCE_CODE) REFERENCES THE.SILV_FUND_SRCE_CODE(SILV_FUND_SRCE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SMC_FK FOREIGN KEY (SILV_METHOD_CODE) REFERENCES THE.SILV_METHOD_CODE(SILV_METHOD_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SMC_PLND_FK FOREIGN KEY (PLAN_SILV_METHOD_CODE) REFERENCES THE.SILV_METHOD_CODE(SILV_METHOD_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SOC1_FK FOREIGN KEY (SILV_OBJECTIVE_CODE_1) REFERENCES THE.SILV_OBJECTIVE_CODE(SILV_OBJECTIVE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SOC2_FK FOREIGN KEY (SILV_OBJECTIVE_CODE_2) REFERENCES THE.SILV_OBJECTIVE_CODE(SILV_OBJECTIVE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SOC3_FK FOREIGN KEY (SILV_OBJECTIVE_CODE_3) REFERENCES THE.SILV_OBJECTIVE_CODE(SILV_OBJECTIVE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SOC_PLND1_FK FOREIGN KEY (PLAN_SILV_OBJECTIVE_CODE_1) REFERENCES THE.SILV_OBJECTIVE_CODE(SILV_OBJECTIVE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SOC_PLND2_FK FOREIGN KEY (PLAN_SILV_OBJECTIVE_CODE_2) REFERENCES THE.SILV_OBJECTIVE_CODE(SILV_OBJECTIVE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SOC_PLND3_FK FOREIGN KEY (PLAN_SILV_OBJECTIVE_CODE_3) REFERENCES THE.SILV_OBJECTIVE_CODE(SILV_OBJECTIVE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SSC_FK FOREIGN KEY (SILV_SYSTEM_CODE) REFERENCES THE.SILV_SYSTEM_CODE(SILV_SYSTEM_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_SSVC_FK FOREIGN KEY (SILV_SYSTEM_VARIANT_CODE) REFERENCES THE.SILV_SYSTEM_VARIANT_CODE(SILV_SYSTEM_VARIANT_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_STC_FK FOREIGN KEY (SILV_TECHNIQUE_CODE) REFERENCES THE.SILV_TECHNIQUE_CODE(SILV_TECHNIQUE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_STC_PLND_FK FOREIGN KEY (PLAN_SILV_TECHNIQUE_CODE) REFERENCES THE.SILV_TECHNIQUE_CODE(SILV_TECHNIQUE_CODE); +--ALTER TABLE THE.ACTIVITY_TREATMENT_UNIT ADD CONSTRAINT ATU_STSC_FK FOREIGN KEY (SILV_TREE_SPECIES_CODE) REFERENCES THE.SILV_TREE_SPECIES_CODE(SILV_TREE_SPECIES_CODE); + +-- THE.SILV_RELIEF_APPLICATION foreign keys + +ALTER TABLE THE.SILV_RELIEF_APPLICATION ADD CONSTRAINT SRA_ATU_FK FOREIGN KEY (ACTIVITY_TREATMENT_UNIT_ID) REFERENCES THE.ACTIVITY_TREATMENT_UNIT(ACTIVITY_TREATMENT_UNIT_ID); +ALTER TABLE THE.SILV_RELIEF_APPLICATION ADD CONSTRAINT SRA_OAH_FK FOREIGN KEY (AMENDMENT_OPENING_ID,OPENING_AMENDMENT_NUMBER) REFERENCES THE.OPENING_AMENDMENT_HISTORY(OPENING_ID,OPENING_AMENDMENT_NUMBER); +--ALTER TABLE THE.SILV_RELIEF_APPLICATION ADD CONSTRAINT SRA_SRASCD_FK FOREIGN KEY (SILV_RELIEF_APPL_STATUS_CODE) REFERENCES THE.SILV_RELIEF_APPL_STATUS_CODE(SILV_RELIEF_APPL_STATUS_CODE); + +-- THE.STOCKING_STANDARD_UNIT foreign keys +ALTER TABLE THE.STOCKING_STANDARD_UNIT ADD CONSTRAINT SSU_O_FK FOREIGN KEY (OPENING_ID) REFERENCES THE.OPENING(OPENING_ID); +--ALTER TABLE THE.STOCKING_STANDARD_UNIT ADD CONSTRAINT SSU_SR_FK FOREIGN KEY (STANDARDS_REGIME_ID) REFERENCES THE.STANDARDS_REGIME(STANDARDS_REGIME_ID); -- This table belongs to CLIENT. Is being added here just for the sake of the VIEW below. + CREATE TABLE THE.FOREST_CLIENT ( CLIENT_NUMBER VARCHAR2(8) NOT NULL, CLIENT_NAME VARCHAR2(60) NOT NULL, @@ -395,17 +712,17 @@ CREATE TABLE THE.FOREST_CLIENT ( UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, REVISION_COUNT NUMBER(5,0) NOT NULL, CONSTRAINT FOREST_CLIENT_PK PRIMARY KEY (CLIENT_NUMBER), - CONSTRAINT SYS_C0029588 CHECK ("CLIENT_NUMBER" IS NOT NULL), - CONSTRAINT SYS_C0029589 CHECK ("CLIENT_NAME" IS NOT NULL), - CONSTRAINT SYS_C0029590 CHECK ("CLIENT_STATUS_CODE" IS NOT NULL), - CONSTRAINT SYS_C0029591 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), - CONSTRAINT SYS_C0029592 CHECK ("ADD_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0029593 CHECK ("ADD_USERID" IS NOT NULL), - CONSTRAINT SYS_C0029594 CHECK ("ADD_ORG_UNIT" IS NOT NULL), - CONSTRAINT SYS_C0029595 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), - CONSTRAINT SYS_C0029596 CHECK ("UPDATE_USERID" IS NOT NULL), - CONSTRAINT SYS_C0029597 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), - CONSTRAINT SYS_C0029598 CHECK ("REVISION_COUNT" IS NOT NULL) + CONSTRAINT SYS_C0029588_FC_CT CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0029589_FC_CT CHECK ("CLIENT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029590_FC_CT CHECK ("CLIENT_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029591_FC_CT CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029592_FC_CT CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029593_FC_CT CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029594_FC_CT CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0029595_FC_CT CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029596_FC_CT CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029597_FC_CT CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0029598_FC_CT CHECK ("REVISION_COUNT" IS NOT NULL) ); CREATE UNIQUE INDEX FC_ACRONYM_I ON THE.FOREST_CLIENT (CLIENT_ACRONYM); CREATE INDEX FC_CITC_FK_I ON THE.FOREST_CLIENT (CLIENT_ID_TYPE_CODE); diff --git a/backend/src/test/resources/migration/oracle/V002__oracle_code_tables.sql b/backend/src/test/resources/migration/oracle/V002__oracle_code_tables.sql index e340fb82..d66c0b99 100644 --- a/backend/src/test/resources/migration/oracle/V002__oracle_code_tables.sql +++ b/backend/src/test/resources/migration/oracle/V002__oracle_code_tables.sql @@ -1438,4 +1438,54 @@ INSERT INTO THE.ORG_UNIT (ORG_UNIT_NO,ORG_UNIT_CODE,ORG_UNIT_NAME,LOCATION_CODE, (2, 'TWO', 'Org two', '002', 'BBB', '2233445', 'R', 'CA', 333, '3Code', 444, '44Code', TO_DATE('2020-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2022-12-31 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2022-12-31 00:00:00', 'YYYY-MM-DD HH24:MI:SS')), (70,'HVA','Timber Pricing Branch','010','250','3871701','H','VA',0,' ',0,' ',TO_DATE('1905-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'),TO_DATE('9999-12-31 00:00:00', 'YYYY-MM-DD HH24:MI:SS'),TO_DATE('2011-08-29 15:49:08', 'YYYY-MM-DD HH24:MI:SS')); - +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('UPD', 'Update', TIMESTAMP '2001-11-19 00:00:00.000000', TIMESTAMP '9999-12-30 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('COR', 'Correction', TIMESTAMP '1905-01-01 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('O', 'Original', TIMESTAMP '2005-04-01 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('197', 'Section 197', TIMESTAMP '2010-02-04 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('AMG', 'Amalgamate', TIMESTAMP '2005-04-07 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('ES', 'E-submission', TIMESTAMP '2004-06-01 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('MIL', 'Milestone', TIMESTAMP '2007-08-07 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('MIN', 'Amended (Minor)', TIMESTAMP '2005-08-01 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('SPA', 'Site Plan Amendment', TIMESTAMP '2007-08-07 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('VAR', 'Variation', TIMESTAMP '2004-05-18 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('AMD', 'Amended', TIMESTAMP '1905-01-01 00:00:00.000000', TIMESTAMP '9999-12-30 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('APP', 'Approved', TIMESTAMP '1905-01-01 00:00:00.000000', TIMESTAMP '9999-12-30 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('DEL', 'Deleted', TIMESTAMP '1905-01-01 00:00:00.000000', TIMESTAMP '9999-12-30 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('REJ', 'Rejected', TIMESTAMP '1905-01-01 00:00:00.000000', TIMESTAMP '9999-12-30 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('RET', 'Retired', TIMESTAMP '2013-10-21 00:00:00.000000', TIMESTAMP '9999-12-31 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('RMD', 'Removed', TIMESTAMP '2006-08-31 00:00:00.000000', TIMESTAMP '2015-05-11 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); +INSERT INTO THE.RESULTS_AUDIT_ACTION_CODE +(RESULTS_AUDIT_ACTION_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) +VALUES('SUB', 'Submitted', TIMESTAMP '1905-01-01 00:00:00.000000', TIMESTAMP '9999-12-30 00:00:00.000000', TIMESTAMP '2015-05-12 09:40:54.000000'); \ No newline at end of file diff --git a/backend/src/test/resources/migration/oracle/V003__oracle_test_data.sql b/backend/src/test/resources/migration/oracle/V003__oracle_test_data.sql index 87eceb37..f9f50115 100644 --- a/backend/src/test/resources/migration/oracle/V003__oracle_test_data.sql +++ b/backend/src/test/resources/migration/oracle/V003__oracle_test_data.sql @@ -1,4 +1,30 @@ - insert into THE.OPEN_CATEGORY_CODE ( +insert into THE.FOREST_CLIENT ( + CLIENT_NUMBER, + CLIENT_TYPE_CODE, + CLIENT_NAME, + LEGAL_FIRST_NAME, + LEGAL_MIDDLE_NAME, + CLIENT_STATUS_CODE, + BIRTHDATE, + REGISTRY_COMPANY_TYPE_CODE, + CORP_REGN_NMBR, + CLIENT_ACRONYM, + CLIENT_ID_TYPE_CODE, + CLIENT_IDENTIFICATION, + WCB_FIRM_NUMBER, + OCG_SUPPLIER_NMBR, + CLIENT_COMMENT, + ADD_TIMESTAMP, + ADD_USERID, + ADD_ORG_UNIT, + UPDATE_TIMESTAMP, + UPDATE_USERID, + UPDATE_ORG_UNIT, + REVISION_COUNT +) +values ('00000001', 'C', 'JERROM', null, null, 'ACT', null, 'BC', '0000001', null, null, null, null, null, null, CURRENT_TIMESTAMP(6), 'IDIR\\ejerrom0', 1, CURRENT_TIMESTAMP(6), 'IDIR\\jjerrom0', 1, 3); + +insert into THE.OPEN_CATEGORY_CODE ( OPEN_CATEGORY_CODE, DESCRIPTION, EFFECTIVE_DATE, @@ -9,7 +35,7 @@ ('BBB', 'BBB description expired', TO_DATE('2020-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2022-12-31 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2022-12-31 00:00:00', 'YYYY-MM-DD HH24:MI:SS')); - insert into THE.OPENING ( +insert into THE.OPENING ( OPENING_ID, OPENING_STATUS_CODE, OPEN_CATEGORY_CODE, @@ -19,11 +45,12 @@ ENTRY_USERID, ENTRY_TIMESTAMP, UPDATE_USERID, - UPDATE_TIMESTAMP + UPDATE_TIMESTAMP, + ORG_UNIT_NO ) values - (101,'APP', 'FTML', 1, 1, 1,'idir-here', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'idir-here', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')), - (102,'APP', 'FTML', 1, 1, 1,'IDIR\\OTTOMATED', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\\OTTOMATED', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')), - (103,'APP', 'FTML', 1, 1, 1,'IDIR\\TTESTER', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\\TTESTER', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')); + (101,'APP', 'FTML', 1, 1, 1,'idir-here', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'idir-here', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 1), + (102,'APP', 'FTML', 1, 1, 1,'IDIR\\OTTOMATED', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\OTTOMATED', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 1), + (103,'APP', 'FTML', 1, 2, 1,'IDIR@TTESTER', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 2); INSERT INTO THE.CUT_BLOCK_OPEN_ADMIN ( CUT_BLOCK_OPEN_ADMIN_ID, @@ -45,3 +72,215 @@ INSERT INTO THE.CUT_BLOCK_OPEN_ADMIN ( (112, 'TFL48', '13T', '48/13S', '13-70', 13.9, TO_DATE('2024-01-22 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2024-01-23 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 102,1,'TEST', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'TEST', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')), (113, 'TFL49', '14T', '49/14S', '14-71', 14.9, TO_DATE('2024-01-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2024-01-25 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 103,1,'TEST', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'TEST', TO_DATE('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')); +--TODO: Generate some random THE.OPENING_ATTACHMENT records + +INSERT INTO THE.RESULTS_ELECTRONIC_SUBMISSION +( + RESULTS_SUBMISSION_ID, + SUBMISSION_TIMESTAMP, + SUBMITTED_BY, + CLIENT_NUMBER, + CLIENT_LOCN_CODE, + ORG_UNIT_NO, + USER_FILENAME, + USER_REFERENCE, + ENTRY_USERID, + ENTRY_TIMESTAMP, + UPDATE_USERID, + UPDATE_TIMESTAMP, + REVISION_COUNT +) +VALUES(111, TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', '00000001', '01', 1, 'my opening.xml', NULL, 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 1); + +INSERT INTO THE.SILV_ADMIN_ZONE +( + DIST_ADMIN_ZONE, + ORG_UNIT_NO, + ADMIN_ZONE_DESC, + REVISION_COUNT +) +VALUES('A', 1, 'TEST VALLEY', 1); + +INSERT INTO THE.OPENING_AMENDMENT_HISTORY +( + OPENING_ID, + OPENING_AMENDMENT_NUMBER, + AMENDMENT_USERID, + AMENDMENT_DATE, + SUBMITTED_BY_USERID, + SUBMITTED_DATE, + APP_ENT_BY_USERID, + APPROVE_DATE, + ENTRY_USERID, + ENTRY_TIMESTAMP, + UPDATE_USERID, + UPDATE_TIMESTAMP, + REVISION_COUNT +) +VALUES(101, 1, 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER, IDIR\OTTOMATED', TO_DATE('2024-01-20 10:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'RESULTS_CONV', TO_DATE('2024-01-20 10:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'RESULTS_CONV', TO_DATE('2024-01-20 12:00:00', 'YYYY-MM-DD HH24:MI:SS'), 1); + +INSERT INTO THE.STOCKING_EVENT_HISTORY +( + STOCKING_EVENT_HISTORY_ID, + OPENING_ID, + OPENING_AMENDMENT_ID, + OPENING_AMENDMENT_NUMBER, + RESULTS_AUDIT_ACTION_CODE, + SUBMITTED_USERID, + RESULTS_SUBMISSION_ID, + AMEND_EVENT_TIMESTAMP, + ENTRY_USERID, + ENTRY_TIMESTAMP, + REVISION_COUNT +) +VALUES(111, 101, 101, 1, 'O', 'Results data conversion', 111, TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'Results data conversion', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 1); + +INSERT INTO THE.RESULTS_AUDIT_EVENT +( + RESULTS_AUDIT_EVENT_ID, + OPENING_ID, + STANDARDS_REGIME_ID, + SILVICULTURE_PROJECT_ID, + RESULTS_AUDIT_ACTION_CODE, + ACTION_DATE, + DESCRIPTION, + USER_ID, + EMAIL_SENT_IND, + XML_SUBMISSION_ID, + OPENING_AMENDMENT_NUMBER, + ENTRY_USERID, + ENTRY_TIMESTAMP +) +VALUES(1, 101, NULL, NULL, 'SUB', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'Forest Cover 0000000', NULL, 'Y', 101, 101, 'TEST\OTTOMATED', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS')); + +INSERT INTO THE.ACTIVITY_TREATMENT_UNIT +( + ACTIVITY_TREATMENT_UNIT_ID, + ACTIVITY_TU_SEQ_NO, + ORG_UNIT_NO, + OPENING_ID, + SILVICULTURE_PROJECT_ID, + PROJECT_UNIT_ID, + SILV_BASE_CODE, + SILV_TECHNIQUE_CODE, + SILV_METHOD_CODE, + SILV_OBJECTIVE_CODE_1, + SILV_OBJECTIVE_CODE_2, + SILV_OBJECTIVE_CODE_3, + SILV_FUND_SRCE_CODE, + SILV_ACTIVITY_MEASUREMENT_CODE, + ACTIVITY_LICENSEE_ID, + TREATMENT_AMOUNT, + ACTUAL_TREATMENT_COST, + ACT_PLANTED_NO, + PLAN_SILV_TECHNIQUE_CODE, + PLAN_SILV_METHOD_CODE, + PLAN_SILV_FUND_SRCE_CODE, + PLANNED_DATE, + PLANNED_TREATMENT_AMOUNT, + PLANNED_TREATMENT_COST, + PLAN_SILV_OBJECTIVE_CODE_1, + PLAN_SILV_OBJECTIVE_CODE_2, + PLAN_SILV_OBJECTIVE_CODE_3, + TARGET_PREPARED_SPOTS, + PRUNING_MIN_CROWN_PCT, + PRUNE_HEIGHT, + STEMS_TO_PRUNE, + MIN_ACCEPTABLE_DENSITY, + TOTAL_STEMS_PER_HA, + INTER_TREE_TARGET_DISTANCE, + INTER_TREE_VARIATION, + INTER_TREE_MIN_DISTANCE, + MAX_TREES_PER_PLOT, + MAX_TREES_PER_HA, + SURVEY_PLANNED_NUM_PLOTS, + SURVEY_ACTUAL_NUM_PLOTS, + SURVEY_MIN_PLOTS_PER_STRATUM, + SILV_TREE_SPECIES_CODE, + ATU_START_DATE, + ATU_COMPLETION_DATE, + RESULTS_IND, + UNIT_BID_PRICE, + FIA_PROJECT_ID, + RESULTS_SUBMISSION_ID, + DISTURBANCE_CODE, + SILV_SYSTEM_CODE, + SILV_SYSTEM_VARIANT_CODE, + SILV_CUT_PHASE_CODE, + CUT_BLOCK_OPEN_ADMIN_ID, + DISTURBANCE_COMPLETED_IND, + ENTRY_USERID, + ENTRY_TIMESTAMP, + UPDATE_USERID, + UPDATE_TIMESTAMP, + REVISION_COUNT +) +VALUES(101, 1, 1, 101, NULL, NULL, 'SU', 'RG', 'PLOT', 'RG', NULL, NULL, 'VOI', 'HA', NULL, 13.5, NULL, 0, 'RG', 'PLOT', 'VOI', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 13.5, NULL, 'RG', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'Y', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), ' DATAFIX_ABP_2014', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 2); + +INSERT INTO THE.SILV_RELIEF_APPLICATION +( + SILV_RELIEF_APPLICATION_ID, + SILV_RELIEF_APPLICATION_NO, + ACTIVITY_TREATMENT_UNIT_ID, + SILV_RELIEF_APPL_STATUS_CODE, + PRE_EVENT_FOREST_COVER_DATE, + POST_EVENT_FOREST_COVER_DATE, + AMENDMENT_OPENING_ID, + OPENING_AMENDMENT_NUMBER, + OBLIGATION_RELIEF_IND, + OBLIGATION_MET_IND, + CAUSE_DAMAGE_IND, + OFFICIALLY_INDUCED_ERROR_IND, + DUE_DILIGENCE_IND, + AUTHORIZATION_CHECKED_IND, + SUBMITTED_DATE, + SUBMITTED_BY_USERID, + APPROVED_DATE, + APPROVED_BY_USERID, + REJECT_COMMENT, + ENTRY_USERID, + ENTRY_TIMESTAMP, + UPDATE_USERID, + UPDATE_TIMESTAMP, + REVISION_COUNT +) +VALUES(101, 1, 101, 'APP', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2024-01-20 08:00:00', 'YYYY-MM-DD HH24:MI:SS'), 101, 1, 'N', 'Y', 'Y', 'N', 'N', 'Y', TO_DATE('2024-01-20 08:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', TO_DATE('2024-01-20 08:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', NULL, 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'IDIR\TTESTER', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 4); + +INSERT INTO THE.STOCKING_STANDARD_UNIT +( + STOCKING_STANDARD_UNIT_ID, + OPENING_ID, + STANDARDS_UNIT_ID, + STANDARDS_REGIME_ID, + NET_AREA, + MAX_ALLOW_SOIL_DISTURBANCE_PCT, + VARIANCE_IND, + ENTRY_USERID, + ENTRY_TIMESTAMP, + UPDATE_USERID, + UPDATE_TIMESTAMP, + REVISION_COUNT +) +VALUES(101, 101, '1', NULL, 0, 0, NULL, 'RESULTS_CONV', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'RESULTS_CONV', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 5); + +INSERT INTO THE.STOCKING_MILESTONE +( + STOCKING_STANDARD_UNIT_ID, + SILV_MILESTONE_TYPE_CODE, + RESULTS_SUBMISSION_ID, + DECLARED_DATE, + DECLARED_USERID, + DECLARE_IND, + DECLARATION_SUBMITTED_DATE, + EARLY_OFFSET_YEARS, + LATE_OFFSET_YEARS, + DUE_EARLY_DATE, + DUE_LATE_DATE, + ENTRY_USERID, + ENTRY_TIMESTAMP, + UPDATE_USERID, + UPDATE_TIMESTAMP, + REVISION_COUNT, + EXTENT_FEASIBLE_DECLARED_IND +) +VALUES(101, 'FG', NULL, NULL, NULL, 'N', NULL, 12, 15, NULL, NULL, 'RESULTS_CONV', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 'RESULTS_CONV', TO_DATE('2024-01-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS'), 1, 'N');