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 delta constraint around leak types #355

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion update/delta/delta_1.4.0_003_create_fk_leak_type.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ALTER TABLE qwat_od.leak ADD column fk_type integer;

CREATE TABLE qwat_vl.leak_type () INHERITS ( qwat_vl.value_list_base);
ALTER TABLE qwat_vl.leak_type ADD CONSTRAINT vl_leak_type_pk PRIMARY KEY (id);
COMMENT ON TABLE qwat_vl.leak_type IS 'leak types';


/* Values */
INSERT INTO qwat_vl.leak_type (id, value_en, value_fr, value_ro ) VALUES (101, 'other', 'autre', 'alta');
Expand All @@ -22,4 +24,4 @@ INSERT INTO qwat_vl.leak_type (id, vl_active, value_en, value_fr, value_ro) VALU



ALTER TABLE qwat_od.valve ADD CONSTRAINT valve_fk_leak_type FOREIGN KEY (fk_leak_type) REFERENCES qwat_vl.leak_type(id) MATCH FULL; CREATE INDEX fki_valve_fk_leak_type ON qwat_od.valve(fk_leak_type);
ALTER TABLE qwat_od.leak ADD CONSTRAINT leak_fk_type FOREIGN KEY (fk_type) REFERENCES qwat_vl.leak_type(id) MATCH FULL; CREATE INDEX fki_leak_type ON qwat_od.leak(fk_type);
2 changes: 1 addition & 1 deletion value_lists/vl_leak_type.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* CREATE */
CREATE TABLE qwat_vl.leak_type () INHERITS ( qwat_vl.value_list_base);
ALTER TABLE qwat_vl.leak_type ADD CONSTRAINT vl_leak_type_pk PRIMARY KEY (id);
COMMENT ON TABLE qwat_vl.leak_type IS 'types of leak';
COMMENT ON TABLE qwat_vl.leak_type IS 'leak types';

/* VALUES */
INSERT INTO qwat_vl.leak_type (id, value_en, value_fr, value_ro ) VALUES (101, 'other', 'autre', 'alta');
Expand Down