-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Henry Saldyga <[email protected]>
- Loading branch information
Showing
3 changed files
with
138 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
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,32 @@ | ||
ALTER TABLE "wfprev"."project" ADD COLUMN "primary_objective_type_code" varchar(10); | ||
COMMENT ON COLUMN "wfprev"."project"."primary_objective_type_code" | ||
IS 'primary_objective_type_code: Is a foreign key to objective_type_code: Objective Type Code is the set of objectives that are desired outcomes for a project. Values are: - Wildfire Risk Reduction - Critical Infrastructure - Ecosystem Restoration - Egress/Evacuation - Forest Health - Hazard Abatement - Range Habitat Management - Reconciliation - Wildfire Habitat Management - Other'; | ||
CREATE INDEX "prjct_objtcd_primary_idx" ON "wfprev"."project" ("primary_objective_type_code" ASC); | ||
ALTER TABLE "wfprev"."project" ADD CONSTRAINT "prjct_objtcd_primary_fk" | ||
FOREIGN KEY ("primary_objective_type_code") REFERENCES "wfprev"."objective_type_code" ("objective_type_code") ON DELETE No Action ON UPDATE No Action; | ||
|
||
ALTER TABLE "wfprev"."project" ADD COLUMN "secondary_objective_type_code" varchar(10); | ||
COMMENT ON COLUMN "wfprev"."project"."secondary_objective_type_code" | ||
IS 'secondary_objective_type_code: Is a foreign key to objective_type_code: Objective Type Code is the set of objectives that are desired outcomes for a project. Values are: - Wildfire Risk Reduction - Critical Infrastructure - Ecosystem Restoration - Egress/Evacuation - Forest Health - Hazard Abatement - Range Habitat Management - Reconciliation - Wildfire Habitat Management - Other'; | ||
CREATE INDEX "prjct_objtcd_secondary_idx" ON "wfprev"."project" ("secondary_objective_type_code" ASC); | ||
ALTER TABLE "wfprev"."project" ADD CONSTRAINT "prjct_objtcd_secondary_fk" | ||
FOREIGN KEY ("secondary_objective_type_code") REFERENCES "wfprev"."objective_type_code" ("objective_type_code") ON DELETE No Action ON UPDATE No Action; | ||
|
||
ALTER TABLE "wfprev"."project" ADD COLUMN "secondary_objective_rationale" varchar(200); | ||
COMMENT ON COLUMN "wfprev"."project"."secondary_objective_rationale" | ||
IS 'Secondary Objective Rationale may be supplied when a Secondary Objective Type code is specified.'; | ||
|
||
ALTER TABLE "wfprev"."project" ADD COLUMN "tertiary_objective_type_code" varchar(10); | ||
COMMENT ON COLUMN "wfprev"."project"."tertiary_objective_type_code" | ||
IS 'tertiary_objective_type_code: Is a foreign key to objective_type_code: Objective Type Code is the set of objectives that are desired outcomes for a project. Values are: - Wildfire Risk Reduction - Critical Infrastructure - Ecosystem Restoration - Egress/Evacuation - Forest Health - Hazard Abatement - Range Habitat Management - Reconciliation - Wildfire Habitat Management - Other'; | ||
CREATE INDEX "prjct_objtcd_tertiary_idx" ON "wfprev"."project" ("tertiary_objective_type_code" ASC); | ||
ALTER TABLE "wfprev"."project" ADD CONSTRAINT "prjct_objtcd_tertiary_fk" | ||
FOREIGN KEY ("tertiary_objective_type_code") REFERENCES "wfprev"."objective_type_code" ("objective_type_code") ON DELETE No Action ON UPDATE No Action; | ||
|
||
ALTER TABLE "wfprev"."project" ADD COLUMN "tertiary_objective_rationale" varchar(200); | ||
COMMENT ON COLUMN "wfprev"."project"."tertiary_objective_rationale" | ||
IS 'Tertiary Objective Rationale may be supplied when a Tertiary Objective Type code is specified.'; | ||
|
||
|
||
|
||
|
75 changes: 75 additions & 0 deletions
75
db/scripts/01_00_03/00/ddl/WFPREV.create_objective_type_code.sql
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,75 @@ | ||
/* ---------------------------------------------------- */ | ||
/* Generated by Enterprise Architect Version 12.0 */ | ||
/* Created On : 10-Dec-2024 4:38:45 PM */ | ||
/* DBMS : PostgreSQL */ | ||
/* ---------------------------------------------------- */ | ||
|
||
/* Create Tables */ | ||
|
||
CREATE TABLE "wfprev"."objective_type_code" | ||
( | ||
"objective_type_code" varchar(10) NOT NULL, -- objective_type_code: Objective Type Code is the set of objectives that are desired outcomes for a project. Values are: - Wildfire Risk Reduction - Critical Infrastructure - Ecosystem Restoration - Egress/Evacuation - Forest Health - Hazard Abatement - Range Habitat Management - Reconciliation - Wildfire Habitat Management - Other | ||
"description" varchar(200) NOT NULL, -- DESCRIPTION is the display quality description of the code value. | ||
"display_order" decimal(3) NULL, -- DISPLAY ORDER is to allow non alphabetic sorting e.g. M T W Th F S S. | ||
"effective_date" DATE NOT NULL DEFAULT CURRENT_DATE, -- EFFECTIVE_DATE is the date code value becomes effective. | ||
"expiry_date" DATE NOT NULL DEFAULT '9999-12-31', -- EXPIRY_DATE is the date code value expires. | ||
"revision_count" decimal(10) NOT NULL DEFAULT 0, -- REVISION_COUNT is the number of times that the row of data has been changed. The column is used for optimistic locking via application code. | ||
"create_user" varchar(64) NOT NULL, -- CREATE_USER is an audit column that indicates the user that created the record. | ||
"create_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP, -- CREATE_DATE is the date and time the row of data was created. | ||
"update_user" varchar(64) NOT NULL, -- UPDATE_USER is an audit column that indicates the user that updated the record. | ||
"update_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP -- UPDATE_DATE is the date and time the row of data was updated. | ||
) | ||
TABLESPACE PG_DEFAULT | ||
; | ||
|
||
/* Create Table Comments, Sequences for Autonumber Columns */ | ||
|
||
COMMENT ON TABLE "wfprev"."objective_type_code" | ||
IS 'Objective Type Code is the set of objectives that are desired outcomes for a project. Values are: - Wildfire Risk Reduction - Critical Infrastructure - Ecosystem Restoration - Egress/Evacuation - Forest Health - Hazard Abatement - Range Habitat Management - Reconciliation - Wildfire Habitat Management - Other' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."objective_type_code" | ||
IS 'objective_type_code: Objective Type Code is the set of objectives that are desired outcomes for a project. Values are: - Wildfire Risk Reduction - Critical Infrastructure - Ecosystem Restoration - Egress/Evacuation - Forest Health - Hazard Abatement - Range Habitat Management - Reconciliation - Wildfire Habitat Management - Other' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."description" | ||
IS 'DESCRIPTION is the display quality description of the code value.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."display_order" | ||
IS 'DISPLAY ORDER is to allow non alphabetic sorting e.g. M T W Th F S S.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."effective_date" | ||
IS 'EFFECTIVE_DATE is the date code value becomes effective.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."expiry_date" | ||
IS 'EXPIRY_DATE is the date code value expires.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."revision_count" | ||
IS 'REVISION_COUNT is the number of times that the row of data has been changed. The column is used for optimistic locking via application code.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."create_user" | ||
IS 'CREATE_USER is an audit column that indicates the user that created the record.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."create_date" | ||
IS 'CREATE_DATE is the date and time the row of data was created.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."update_user" | ||
IS 'UPDATE_USER is an audit column that indicates the user that updated the record.' | ||
; | ||
|
||
COMMENT ON COLUMN "wfprev"."objective_type_code"."update_date" | ||
IS 'UPDATE_DATE is the date and time the row of data was updated.' | ||
; | ||
|
||
/* Create Primary Keys, Indexes, Uniques, Checks */ | ||
|
||
ALTER TABLE "wfprev"."objective_type_code" ADD CONSTRAINT "objtcd_pk" | ||
PRIMARY KEY ("objective_type_code") | ||
; |