[open-ils-commits] r17063 - in trunk/Open-ILS/src/sql/Pg: . upgrade (atz)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 2 15:16:07 EDT 2010


Author: atz
Date: 2010-08-02 15:16:02 -0400 (Mon, 02 Aug 2010)
New Revision: 17063

Modified:
   trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql
   trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
   trunk/Open-ILS/src/sql/Pg/upgrade/0356.schema.missing-pkey-constraints.sql
Log:
0356 fixup - the updates otherwise failed for syntax or dependent constraints

Modified: trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql	2010-08-02 17:17:55 UTC (rev 17062)
+++ trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql	2010-08-02 19:16:02 UTC (rev 17063)
@@ -47,7 +47,7 @@
         LIKE staging.mailing_address_stage INCLUDING DEFAULTS
 );
 
-ALTER TABLE staging.billing_address_stage ADD CONSTRAINT PRIMARY KEY (row_id);
+ALTER TABLE staging.billing_address_stage ADD PRIMARY KEY (row_id);
 
 CREATE TABLE staging.statcat_stage (
         row_id          BIGSERIAL PRIMARY KEY,

Modified: trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/080.schema.money.sql	2010-08-02 17:17:55 UTC (rev 17062)
+++ trunk/Open-ILS/src/sql/Pg/080.schema.money.sql	2010-08-02 19:16:02 UTC (rev 17063)
@@ -259,7 +259,7 @@
 CREATE OR REPLACE VIEW money.billable_xact_summary AS 
     SELECT * FROM money.materialized_billable_xact_summary;
 
-ALTER TABLE money.materialized_billable_xact_summary ADD CONSTRAINT PRIMARY KEY (id);
+ALTER TABLE money.materialized_billable_xact_summary ADD PRIMARY KEY (id);
 
 CREATE INDEX money_mat_summary_usr_idx ON money.materialized_billable_xact_summary (usr);
 CREATE INDEX money_mat_summary_xact_start_idx ON money.materialized_billable_xact_summary (xact_start);

Modified: trunk/Open-ILS/src/sql/Pg/upgrade/0356.schema.missing-pkey-constraints.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0356.schema.missing-pkey-constraints.sql	2010-08-02 17:17:55 UTC (rev 17062)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0356.schema.missing-pkey-constraints.sql	2010-08-02 19:16:02 UTC (rev 17063)
@@ -2,13 +2,17 @@
 
 INSERT INTO config.upgrade_log (version) VALUES ('0356'); -- miker
 
-ALTER TABLE acq.edi_account DROP CONSTRAINT acq_edi_account_id_unique;
-ALTER TABLE acq.edi_account ADD CONSTRAINT PRIMARY KEY (id);
+ALTER TABLE acq.edi_account ADD PRIMARY KEY (id);
+ALTER TABLE acq.edi_account DROP CONSTRAINT acq_edi_account_id_unique CASCADE;
+
+-- Now rebuild the constraints dropped via cascade.
+ALTER TABLE acq.provider    ADD CONSTRAINT provider_edi_default_fkey FOREIGN KEY (edi_default) REFERENCES acq.edi_account (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE acq.edi_message ADD CONSTRAINT edi_message_account_fkey  FOREIGN KEY (account    ) REFERENCES acq.edi_account (id) DEFERRABLE INITIALLY DEFERRED;
  
 DROP INDEX money.money_mat_summary_id_idx;
-ALTER TABLE money.materialized_billable_xact_summary ADD CONSTRAINT PRIMARY KEY (id);
+ALTER TABLE money.materialized_billable_xact_summary ADD PRIMARY KEY (id);
 
-ALTER TABLE staging.billing_address_stage ADD CONSTRAINT PRIMARY KEY (row_id);
+ALTER TABLE staging.billing_address_stage ADD PRIMARY KEY (row_id);
 
 COMMIT;
 



More information about the open-ils-commits mailing list