From d08b537ba4c9b0fbb1c13fd474e3cdfdd3314941 Mon Sep 17 00:00:00 2001 From: David Erill Date: Tue, 31 Jan 2017 23:33:20 +0100 Subject: [PATCH] Bug fix on sql files --- sql/example/ud/ud_98_sample_other.sql | 8 ++++++-- sql/example/ws/ws_98_sample_other.sql | 6 ++++-- sql/ud/ud_09_cuore_sys_fk.sql | 2 +- sql/ws/ws_09_cuore_sys_fk.sql | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sql/example/ud/ud_98_sample_other.sql b/sql/example/ud/ud_98_sample_other.sql index c66202cf3..4b97f59d6 100644 --- a/sql/example/ud/ud_98_sample_other.sql +++ b/sql/example/ud/ud_98_sample_other.sql @@ -26,6 +26,10 @@ INSERT INTO "inp_selector_sector" VALUES ('sector_01'); --INSERT INTO "plan_selector_psector" VALUES ('psector_01'); - - +-- ---------------------------- +-- Default values of rpt selectors +-- ---------------------------- +INSERT INTO rpt_selector_result VALUES (1, 'ud_sample', 'postgres'); +INSERT INTO rpt_selector_compare VALUES (1, 'ud_sample_hy', 'postgres'); +SELECT pg_catalog.setval('"SCHEMA_NAME".rpt_selector_result_id_seq', 1, true); diff --git a/sql/example/ws/ws_98_sample_other.sql b/sql/example/ws/ws_98_sample_other.sql index f923e2a82..3a50bada7 100644 --- a/sql/example/ws/ws_98_sample_other.sql +++ b/sql/example/ws/ws_98_sample_other.sql @@ -30,5 +30,7 @@ INSERT INTO inp_selector_sector VALUES ('sector_01'); -- ---------------------------- -- Default values of rpt selectors -- ---------------------------- -INSERT INTO rpt_selector_result VALUES (1, 'sample_epanet', 'postgres'); -INSERT INTO rpt_selector_compare VALUES (1, 'sample_epanet_hy', 'postgres'); \ No newline at end of file +INSERT INTO rpt_selector_result VALUES (1, 'ws_sample', 'postgres'); +INSERT INTO rpt_selector_compare VALUES (1, 'ws_sample_hy', 'postgres'); +SELECT pg_catalog.setval('"SCHEMA_NAME".rpt_selector_result_id_seq', 1, true); + diff --git a/sql/ud/ud_09_cuore_sys_fk.sql b/sql/ud/ud_09_cuore_sys_fk.sql index 846a297ca..cb4f07a85 100644 --- a/sql/ud/ud_09_cuore_sys_fk.sql +++ b/sql/ud/ud_09_cuore_sys_fk.sql @@ -250,7 +250,7 @@ ALTER TABLE "element_x_gully" ADD CONSTRAINT "element_x_gully_gully_id_fkey" FOR --LTER TABLE "db_cat_table" DROP CONSTRAINT IF EXISTS "db_cat_table_db_cat_clientlayer_id_fkey"; --ALTER TABLE db_cat_table ADD CONSTRAINT "db_cat_table_db_cat_clientlayer_id_fkey" FOREIGN KEY ("db_cat_clientlayer_id") REFERENCES db_cat_clientlayer ("qgis_layer_id") ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE "db_cat_table_x_column" DROP CONSTRAINT IF EXISTS "db_cat_table_x_column_db_cat_table_fkey"; -ALTER TABLE db_cat_table_x_column ADD CONSTRAINT db_cat_table_x_column_db_cat_table_fkey FOREIGN KEY (table_id) REFERENCES sample_epaswmm.db_cat_table (id) ON UPDATE CASCADE ON DELETE RESTRICT; +ALTER TABLE db_cat_table_x_column ADD CONSTRAINT db_cat_table_x_column_db_cat_table_fkey FOREIGN KEY (table_id) REFERENCES db_cat_table (id) ON UPDATE CASCADE ON DELETE RESTRICT; ALTER TABLE "samplepoint" DROP CONSTRAINT IF EXISTS "samplepoint_featurecat_id_fkey"; ALTER TABLE "samplepoint" ADD CONSTRAINT "samplepoint_featurecat_id_fkey" FOREIGN KEY ("featurecat_id") REFERENCES "cat_feature" ("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/sql/ws/ws_09_cuore_sys_fk.sql b/sql/ws/ws_09_cuore_sys_fk.sql index e376b5758..0d879c290 100644 --- a/sql/ws/ws_09_cuore_sys_fk.sql +++ b/sql/ws/ws_09_cuore_sys_fk.sql @@ -225,4 +225,4 @@ ALTER TABLE "samplepoint" DROP CONSTRAINT IF EXISTS "samplepoint_workcat_id_end_ ALTER TABLE "samplepoint" ADD CONSTRAINT "samplepoint_workcat_id_end_fkey" FOREIGN KEY ("workcat_id_end") REFERENCES "cat_work" ("id") ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE "db_cat_table_x_column" DROP CONSTRAINT IF EXISTS db_cat_table_x_column_db_cat_table_fkey; -ALTER TABLE db_cat_table_x_column ADD CONSTRAINT db_cat_table_x_column_db_cat_table_fkey FOREIGN KEY (table_id) REFERENCES sample_epanet.db_cat_table (id) ON UPDATE CASCADE ON DELETE RESTRICT; \ No newline at end of file +ALTER TABLE db_cat_table_x_column ADD CONSTRAINT db_cat_table_x_column_db_cat_table_fkey FOREIGN KEY (table_id) REFERENCES db_cat_table (id) ON UPDATE CASCADE ON DELETE RESTRICT; \ No newline at end of file