geosolutions-it/destination — pull request #23 by xandros6 (2013-09-26 17:43:00+00:00)
Title: Fix zero remove and production procedure

New SQL script

ALTER TABLE "siig_p"."siig_r_scen_vuln_1" ADD CONSTRAINT "siig_r_scen_vuln_1_id_geo_arco_fkey" FOREIGN KEY ("id_geo_arco") REFERENCES "siig_p"."siig_geo_ln_arco_1"

("id_geo_arco") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "siig_p"."siig_r_scen_vuln_2" ADD CONSTRAINT "siig_r_scen_vuln_2_id_geo_arco_fkey" FOREIGN KEY ("id_geo_arco") REFERENCES "siig_p"."siig_geo_ln_arco_2"

("id_geo_arco") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "siig_p"."siig_r_scen_vuln_3" ADD CONSTRAINT "siig_r_scen_vuln_3_id_geo_arco_fkey" FOREIGN KEY ("id_geo_arco") REFERENCES "siig_p"."siig_geo_pl_arco_3"

("id_geo_arco") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "siig_p"."siig_r_scen_vuln_1"
ADD COLUMN "fk_partner" varchar(5);

ALTER TABLE "siig_p"."siig_r_scen_vuln_2"
ADD COLUMN "fk_partner" varchar(5);

ALTER TABLE "siig_p"."siig_r_scen_vuln_3"
ADD COLUMN "fk_partner" varchar(5);

ALTER TABLE "siig_p"."siig_r_scen_vuln_1"
DROP CONSTRAINT "fk_siig_t_vulnerabilita_1_02",
ADD CONSTRAINT "fk_siig_t_vulnerabilita_1_02" FOREIGN KEY ("id_geo_arco", "id_distanza") REFERENCES "siig_p"."siig_t_vulnerabilita_1" ("id_geo_arco", "id_distanza") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "siig_p"."siig_r_scen_vuln_2"
DROP CONSTRAINT "fk_siig_t_vulnerabilita_2_02",
ADD CONSTRAINT "fk_siig_t_vulnerabilita_2_02" FOREIGN KEY ("id_geo_arco", "id_distanza") REFERENCES "siig_p"."siig_t_vulnerabilita_2" ("id_geo_arco", "id_distanza") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "siig_p"."siig_r_scen_vuln_3"
DROP CONSTRAINT "fk_siig_t_vulnerabilita_3_02",
ADD CONSTRAINT "fk_siig_t_vulnerabilita_3_02" FOREIGN KEY ("id_geo_arco", "id_distanza") REFERENCES "siig_p"."siig_t_vulnerabilita_3" ("id_geo_arco", "id_distanza") ON DELETE CASCADE ON UPDATE NO ACTION;