Skip to content

Commit

Permalink
fix(constraints): correct wrong constraint names
Browse files Browse the repository at this point in the history
  • Loading branch information
albertbofill committed Dec 24, 2024
1 parent f985e70 commit 5a96cf9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions updates/36/36017/ud/tablect.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,19 @@ SET search_path = SCHEMA_NAME, public, pg_catalog;
CREATE INDEX gully_streetname ON arc USING btree (streetname);
CREATE INDEX gully_streetname2 ON arc USING btree (streetname2);

ALTER TABLE connec DROP CONSTRAINT arc_drainzone_id_fkey;
ALTER TABLE connec ADD CONSTRAINT connec_drainzone_id_fkey FOREIGN KEY (drainzone_id)
REFERENCES drainzone(drainzone_id) ON UPDATE CASCADE ON DELETE RESTRICT;

ALTER TABLE connec DROP CONSTRAINT node_expl_id2_fkey;
ALTER TABLE connec ADD CONSTRAINT connec_expl_id2_fkey FOREIGN KEY (expl_id2)
REFERENCES exploitation(expl_id) ON UPDATE CASCADE ON DELETE RESTRICT;

ALTER TABLE node DROP CONSTRAINT arc_drainzone_id_fkey;
ALTER TABLE node ADD CONSTRAINT node_drainzone_id_fkey FOREIGN KEY (drainzone_id)
REFERENCES drainzone(drainzone_id) ON UPDATE CASCADE ON DELETE RESTRICT;

ALTER TABLE gully DROP CONSTRAINT arc_drainzone_id_fkey;
ALTER TABLE gully ADD CONSTRAINT gully_drainzone_id_fkey FOREIGN KEY (drainzone_id)
REFERENCES drainzone(drainzone_id) ON UPDATE CASCADE ON DELETE RESTRICT;

17 changes: 17 additions & 0 deletions updates/36/36017/ws/tablect.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
This file is part of Giswater 3
The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This version of Giswater is provided by Giswater Association
*/


SET search_path = SCHEMA_NAME, public, pg_catalog;


ALTER TABLE node DROP CONSTRAINT arc_macrominsector_id_fkey;
ALTER TABLE node ADD CONSTRAINT node_macrominsector_id_fkey FOREIGN KEY (macrominsector_id)
REFERENCES macrominsector(macrominsector_id) ON UPDATE CASCADE ON DELETE RESTRICT;

ALTER TABLE connec DROP CONSTRAINT node_expl_id2_fkey;
ALTER TABLE connec ADD CONSTRAINT connec_expl_id2_fkey FOREIGN KEY (expl_id2)
REFERENCES exploitation(expl_id) ON UPDATE CASCADE ON DELETE RESTRICT;

0 comments on commit 5a96cf9

Please sign in to comment.