Skip to content

Commit 33f364a

Browse files
authored
Feature/wfprev 217 (#389)
1 parent 49f5851 commit 33f364a

9 files changed

+550
-1
lines changed

db/app_wf1_prev-changelog.json

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,70 @@
515515
{ "sql": "DROP TABLE wfprev.activity_category_code" }
516516
]
517517
}
518-
}
518+
},
519+
{
520+
"changeSet": {
521+
"id": "01_00_06_00",
522+
"author": "hsaldyga",
523+
"tagDatabase": { "tag" : "version_01_00_06_00" },
524+
"changes": [
525+
{
526+
"sqlFile": {
527+
"dbms": "postgresql", "endDelimiter": ";",
528+
"path": "scripts/01_00_06/00/ddl/WFPREV.attachment_content_type_code.sql"
529+
}
530+
},
531+
{
532+
"sqlFile": {
533+
"dbms": "postgresql", "endDelimiter": ";",
534+
"path": "scripts/01_00_06/00/ddl/WFPREV.event_history_type_code.sql"
535+
}
536+
},
537+
{
538+
"sqlFile": {
539+
"dbms": "postgresql", "endDelimiter": ";",
540+
"path": "scripts/01_00_06/00/ddl/WFPREV.source_object_name_code.sql"
541+
}
542+
},
543+
{
544+
"sqlFile": {
545+
"dbms": "postgresql", "endDelimiter": ";",
546+
"path": "scripts/01_00_06/00/ddl/WFPREV.event_history.sql"
547+
}
548+
},
549+
{
550+
"sqlFile": {
551+
"dbms": "postgresql", "endDelimiter": ";",
552+
"path": "scripts/01_00_06/00/ddl/WFPREV.file_attachment.sql"
553+
}
554+
},
555+
{
556+
"sqlFile": {
557+
"dbms": "postgresql", "endDelimiter": ";",
558+
"path": "scripts/01_00_06/00/dml/app_wf1_prev.dml.attachment_content_type_code.sql"
559+
}
560+
},
561+
{
562+
"sqlFile": {
563+
"dbms": "postgresql", "endDelimiter": ";",
564+
"path": "scripts/01_00_06/00/dml/app_wf1_prev.dml.event_history_type_code.sql"
565+
}
566+
},
567+
{
568+
"sqlFile": {
569+
"dbms": "postgresql", "endDelimiter": ";",
570+
"path": "scripts/01_00_06/00/dml/app_wf1_prev.dml.source_object_name_code.sql"
571+
}
572+
}
573+
],
574+
"rollback": [
575+
{ "sql": "DROP TABLE wfprev.file_attachment" },
576+
{ "sql": "DROP TABLE wfprev.event_history" },
577+
{ "sql": "DROP TABLE wfprev.source_object_name_code" },
578+
{ "sql": "DROP TABLE wfprev.event_history_type_code" },
579+
{ "sql": "DROP TABLE wfprev.attachment_content_type_code" }
580+
]
581+
}
582+
}
519583
]
520584
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/* ---------------------------------------------------- */
2+
/* Generated by Enterprise Architect Version 12.0 */
3+
/* Created On : 18-Dec-2024 1:22:23 PM */
4+
/* DBMS : PostgreSQL */
5+
/* ---------------------------------------------------- */
6+
7+
/* Create Tables */
8+
9+
CREATE TABLE "wfprev"."attachment_content_type_code"
10+
(
11+
"attachment_content_type_code" varchar(30) NOT NULL, -- attachment_content_type_code: Attachment Content Type Code holds the type of document based on the content. For instance, if the document is a Map, this will indicate "Map". The current values are: * Map * Directions * Manifest * Document * Image * Pilot Information Package
12+
"description" varchar(200) NOT NULL, -- DESCRIPTION is the display quality description of the code value.
13+
"display_order" decimal(3) NULL, -- DISPLAY ORDER is to allow non alphabetic sorting e.g. M T W Th F S S.
14+
"effective_date" DATE NOT NULL DEFAULT CURRENT_DATE, -- EFFECTIVE_DATE is the date code value becomes effective.
15+
"expiry_date" DATE NOT NULL DEFAULT '9999-12-31', -- EXPIRY_DATE is the date code value expires.
16+
"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.
17+
"create_user" varchar(64) NOT NULL, -- CREATE_USER is an audit column that indicates the user that created the record.
18+
"create_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP, -- CREATE_DATE is the date and time the row of data was created.
19+
"update_user" varchar(64) NOT NULL, -- UPDATE_USER is an audit column that indicates the user that updated the record.
20+
"update_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP -- UPDATE_DATE is the date and time the row of data was updated.
21+
)
22+
TABLESPACE PG_DEFAULT
23+
;
24+
25+
/* Create Table Comments, Sequences for Autonumber Columns */
26+
27+
COMMENT ON TABLE "wfprev"."attachment_content_type_code"
28+
IS 'Attachment Content Type Code holds the type of document based on the content. For instance, if the document is a Map, this will indicate "Map". The current values are: * Map * Directions * Manifest * Document * Image * Pilot Information Package'
29+
;
30+
31+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."attachment_content_type_code"
32+
IS 'attachment_content_type_code: Attachment Content Type Code holds the type of document based on the content. For instance, if the document is a Map, this will indicate "Map". The current values are: * Map * Directions * Manifest * Document * Image * Pilot Information Package'
33+
;
34+
35+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."description"
36+
IS 'DESCRIPTION is the display quality description of the code value.'
37+
;
38+
39+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."display_order"
40+
IS 'DISPLAY ORDER is to allow non alphabetic sorting e.g. M T W Th F S S.'
41+
;
42+
43+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."effective_date"
44+
IS 'EFFECTIVE_DATE is the date code value becomes effective.'
45+
;
46+
47+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."expiry_date"
48+
IS 'EXPIRY_DATE is the date code value expires.'
49+
;
50+
51+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."revision_count"
52+
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.'
53+
;
54+
55+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."create_user"
56+
IS 'CREATE_USER is an audit column that indicates the user that created the record.'
57+
;
58+
59+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."create_date"
60+
IS 'CREATE_DATE is the date and time the row of data was created.'
61+
;
62+
63+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."update_user"
64+
IS 'UPDATE_USER is an audit column that indicates the user that updated the record.'
65+
;
66+
67+
COMMENT ON COLUMN "wfprev"."attachment_content_type_code"."update_date"
68+
IS 'UPDATE_DATE is the date and time the row of data was updated.'
69+
;
70+
71+
/* Create Primary Keys, Indexes, Uniques, Checks */
72+
73+
ALTER TABLE "wfprev"."attachment_content_type_code" ADD CONSTRAINT "actc_pk"
74+
PRIMARY KEY ("attachment_content_type_code")
75+
;
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/* ---------------------------------------------------- */
2+
/* Generated by Enterprise Architect Version 12.0 */
3+
/* Created On : 18-Dec-2024 1:22:52 PM */
4+
/* DBMS : PostgreSQL */
5+
/* ---------------------------------------------------- */
6+
7+
/* Create Tables */
8+
9+
CREATE TABLE "wfprev"."event_history"
10+
(
11+
"event_history_guid" UUID NOT NULL, -- event_history_guid is a unique identifier for the record.
12+
"event_history_type_code" varchar(10) NOT NULL, -- event_history_type_code: Is a foreign key to event_history_type_code: Event History Type Code describes the types of history events that can be created. Values are: - Event - Comment
13+
"source_object_name_code" varchar(30) NOT NULL, -- source_object_name_code: Is a foreign key to source_object_name_code: Source Object Name Code is a table to hold the name of the table that the attachment belongs to. For instance, when a manifest is attached to a Resource Request, the code value in this table will be RSRC_RQST_SUBMISSION. When a Standing Offer is attached to an Agreement, the value in this table will be AGREEMENT. For this release, there are only two values in this table: * RSRC_RQST_SUBMISSION * AGREEMENT * AIRCRAFT_DETAIL * Resource Unit * Resource Group * Contact * Supplier
14+
"source_object_unique_id" varchar(50) NOT NULL, -- Source Object Unique Identifier is the actual primary key value of the source object that spawned the event. This, along with the Source Object Name will fully identify what the event belongs to.
15+
"event_timestamp" TIMESTAMP NULL, -- Last Updated Timestamp is the date and time the Supplier was last updated.
16+
"event_comment" varchar(4000) NOT NULL, -- Event Comment is either a system generated event comment, or a comment for a manual event added by a staff member.
17+
"event_created_by_user_type" varchar(3) NULL, -- Event Created By User Type corresponds user types stored in the WebADE User_Type_Code table, which has values BC Services Card, Government, Business Partner, Unverified Individual, Verified, Individual, Service Client.
18+
"event_created_by_userid" varchar(100) NULL, -- Event Created By Userid is the IDIR or BCEID userid of the ministry staff member that created the event.
19+
"event_created_by_user_guid" varchar(32) NULL, -- Event Created By User Guid is the user GUID of the ministry staff member that created the event. The user guid is stored in this field corresponds to a user authorized in the WebADE platform.
20+
"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.
21+
"create_user" varchar(64) NOT NULL, -- CREATE_USER is an audit column that indicates the user that created the record.
22+
"create_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP, -- CREATE_DATE is the date and time the row of data was created.
23+
"update_user" varchar(64) NOT NULL, -- UPDATE_USER is an audit column that indicates the user that updated the record.
24+
"update_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP -- UPDATE_DATE is the date and time the row of data was updated.
25+
)
26+
TABLESPACE PG_DEFAULT
27+
;
28+
29+
/* Create Table Comments, Sequences for Autonumber Columns */
30+
31+
COMMENT ON TABLE "wfprev"."event_history"
32+
IS 'Event History is used to track significant events that occur for various modules of the system. For example, the table can track when a create supplier, update supplier, or delete supplier event has occurred. The staff person can add manual events to the tables as comments.'
33+
;
34+
35+
COMMENT ON COLUMN "wfprev"."event_history"."event_history_guid"
36+
IS 'event_history_guid is a unique identifier for the record.'
37+
;
38+
39+
COMMENT ON COLUMN "wfprev"."event_history"."event_history_type_code"
40+
IS 'event_history_type_code: Is a foreign key to event_history_type_code: Event History Type Code describes the types of history events that can be created. Values are: - Event - Comment'
41+
;
42+
43+
COMMENT ON COLUMN "wfprev"."event_history"."source_object_name_code"
44+
IS 'source_object_name_code: Is a foreign key to source_object_name_code: Source Object Name Code is a table to hold the name of the table that the attachment belongs to. For instance, when a manifest is attached to a Resource Request, the code value in this table will be RSRC_RQST_SUBMISSION. When a Standing Offer is attached to an Agreement, the value in this table will be AGREEMENT. For this release, there are only two values in this table: * RSRC_RQST_SUBMISSION * AGREEMENT * AIRCRAFT_DETAIL * Resource Unit * Resource Group * Contact * Supplier'
45+
;
46+
47+
COMMENT ON COLUMN "wfprev"."event_history"."source_object_unique_id"
48+
IS 'Source Object Unique Identifier is the actual primary key value of the source object that spawned the event. This, along with the Source Object Name will fully identify what the event belongs to. '
49+
;
50+
51+
COMMENT ON COLUMN "wfprev"."event_history"."event_timestamp"
52+
IS 'Last Updated Timestamp is the date and time the Supplier was last updated.'
53+
;
54+
55+
COMMENT ON COLUMN "wfprev"."event_history"."event_comment"
56+
IS 'Event Comment is either a system generated event comment, or a comment for a manual event added by a staff member.'
57+
;
58+
59+
COMMENT ON COLUMN "wfprev"."event_history"."event_created_by_user_type"
60+
IS 'Event Created By User Type corresponds user types stored in the WebADE User_Type_Code table, which has values BC Services Card, Government, Business Partner, Unverified Individual, Verified, Individual, Service Client.'
61+
;
62+
63+
COMMENT ON COLUMN "wfprev"."event_history"."event_created_by_userid"
64+
IS 'Event Created By Userid is the IDIR or BCEID userid of the ministry staff member that created the event.'
65+
;
66+
67+
COMMENT ON COLUMN "wfprev"."event_history"."event_created_by_user_guid"
68+
IS 'Event Created By User Guid is the user GUID of the ministry staff member that created the event. The user guid is stored in this field corresponds to a user authorized in the WebADE platform.'
69+
;
70+
71+
COMMENT ON COLUMN "wfprev"."event_history"."revision_count"
72+
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.'
73+
;
74+
75+
COMMENT ON COLUMN "wfprev"."event_history"."create_user"
76+
IS 'CREATE_USER is an audit column that indicates the user that created the record.'
77+
;
78+
79+
COMMENT ON COLUMN "wfprev"."event_history"."create_date"
80+
IS 'CREATE_DATE is the date and time the row of data was created.'
81+
;
82+
83+
COMMENT ON COLUMN "wfprev"."event_history"."update_user"
84+
IS 'UPDATE_USER is an audit column that indicates the user that updated the record.'
85+
;
86+
87+
COMMENT ON COLUMN "wfprev"."event_history"."update_date"
88+
IS 'UPDATE_DATE is the date and time the row of data was updated.'
89+
;
90+
91+
/* Create Primary Keys, Indexes, Uniques, Checks */
92+
93+
ALTER TABLE "wfprev"."event_history" ADD CONSTRAINT "evthist_pk"
94+
PRIMARY KEY ("event_history_guid")
95+
;
96+
97+
ALTER TABLE "wfprev"."event_history" ADD CONSTRAINT "evthist_uk" UNIQUE ("event_history_type_code","source_object_name_code","source_object_unique_id","event_timestamp")
98+
;
99+
100+
CREATE INDEX "evthist_ehtcd_idx" ON "wfprev"."event_history" ("event_history_type_code" ASC)
101+
;
102+
103+
CREATE INDEX "evthist_sonc_idx" ON "wfprev"."event_history" ("source_object_name_code" ASC)
104+
;
105+
106+
/* Create Foreign Key Constraints */
107+
108+
ALTER TABLE "wfprev"."event_history" ADD CONSTRAINT "evthist_ehtcd_fk"
109+
FOREIGN KEY ("event_history_type_code") REFERENCES "wfprev"."event_history_type_code" ("event_history_type_code") ON DELETE No Action ON UPDATE No Action
110+
;
111+
112+
ALTER TABLE "wfprev"."event_history" ADD CONSTRAINT "evthist_sonc_fk"
113+
FOREIGN KEY ("source_object_name_code") REFERENCES "wfprev"."source_object_name_code" ("source_object_name_code") ON DELETE No Action ON UPDATE No Action
114+
;
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/* ---------------------------------------------------- */
2+
/* Generated by Enterprise Architect Version 12.0 */
3+
/* Created On : 18-Dec-2024 1:22:52 PM */
4+
/* DBMS : PostgreSQL */
5+
/* ---------------------------------------------------- */
6+
7+
/* Create Tables */
8+
9+
CREATE TABLE "wfprev"."event_history_type_code"
10+
(
11+
"event_history_type_code" varchar(10) NOT NULL, -- event_history_type_code: Event History Type Code describes the types of history events that can be created. Values are: - Event - Comment
12+
"description" varchar(200) NOT NULL, -- DESCRIPTION is the display quality description of the code value.
13+
"display_order" decimal(3) NULL, -- DISPLAY ORDER is to allow non alphabetic sorting e.g. M T W Th F S S.
14+
"effective_date" DATE NOT NULL DEFAULT CURRENT_DATE, -- EFFECTIVE_DATE is the date code value becomes effective.
15+
"expiry_date" DATE NOT NULL DEFAULT '9999-12-31', -- EXPIRY_DATE is the date code value expires.
16+
"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.
17+
"create_user" varchar(64) NOT NULL, -- CREATE_USER is an audit column that indicates the user that created the record.
18+
"create_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP, -- CREATE_DATE is the date and time the row of data was created.
19+
"update_user" varchar(64) NOT NULL, -- UPDATE_USER is an audit column that indicates the user that updated the record.
20+
"update_date" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP -- UPDATE_DATE is the date and time the row of data was updated.
21+
)
22+
TABLESPACE PG_DEFAULT
23+
;
24+
25+
/* Create Table Comments, Sequences for Autonumber Columns */
26+
27+
COMMENT ON TABLE "wfprev"."event_history_type_code"
28+
IS 'Event History Type Code describes the types of history events that can be created. Values are: - Event - Comment'
29+
;
30+
31+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."event_history_type_code"
32+
IS 'event_history_type_code: Event History Type Code describes the types of history events that can be created. Values are: - Event - Comment'
33+
;
34+
35+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."description"
36+
IS 'DESCRIPTION is the display quality description of the code value.'
37+
;
38+
39+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."display_order"
40+
IS 'DISPLAY ORDER is to allow non alphabetic sorting e.g. M T W Th F S S.'
41+
;
42+
43+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."effective_date"
44+
IS 'EFFECTIVE_DATE is the date code value becomes effective.'
45+
;
46+
47+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."expiry_date"
48+
IS 'EXPIRY_DATE is the date code value expires.'
49+
;
50+
51+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."revision_count"
52+
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.'
53+
;
54+
55+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."create_user"
56+
IS 'CREATE_USER is an audit column that indicates the user that created the record.'
57+
;
58+
59+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."create_date"
60+
IS 'CREATE_DATE is the date and time the row of data was created.'
61+
;
62+
63+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."update_user"
64+
IS 'UPDATE_USER is an audit column that indicates the user that updated the record.'
65+
;
66+
67+
COMMENT ON COLUMN "wfprev"."event_history_type_code"."update_date"
68+
IS 'UPDATE_DATE is the date and time the row of data was updated.'
69+
;
70+
71+
/* Create Primary Keys, Indexes, Uniques, Checks */
72+
73+
ALTER TABLE "wfprev"."event_history_type_code" ADD CONSTRAINT "ehtcd_pk"
74+
PRIMARY KEY ("event_history_type_code")
75+
;

0 commit comments

Comments
 (0)