[open-ils-commits] r17062 - in trunk/Open-ILS/src/sql/Pg: . upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 2 13:17:58 EDT 2010
Author: miker
Date: 2010-08-02 13:17:55 -0400 (Mon, 02 Aug 2010)
New Revision: 17062
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0356.schema.missing-pkey-constraints.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
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/200.schema.acq.sql
Log:
create correct primary key constraints for some view-based / inheritted tables
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-08-02 15:00:51 UTC (rev 17061)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-08-02 17:17:55 UTC (rev 17062)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0355'); -- phasefx
+INSERT INTO config.upgrade_log (version) VALUES ('0356'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql 2010-08-02 15:00:51 UTC (rev 17061)
+++ trunk/Open-ILS/src/sql/Pg/015.schema.staging.sql 2010-08-02 17:17:55 UTC (rev 17062)
@@ -47,6 +47,8 @@
LIKE staging.mailing_address_stage INCLUDING DEFAULTS
);
+ALTER TABLE staging.billing_address_stage ADD CONSTRAINT PRIMARY KEY (row_id);
+
CREATE TABLE staging.statcat_stage (
row_id BIGSERIAL PRIMARY KEY,
row_date TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
Modified: trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/080.schema.money.sql 2010-08-02 15:00:51 UTC (rev 17061)
+++ trunk/Open-ILS/src/sql/Pg/080.schema.money.sql 2010-08-02 17:17:55 UTC (rev 17062)
@@ -259,7 +259,8 @@
CREATE OR REPLACE VIEW money.billable_xact_summary AS
SELECT * FROM money.materialized_billable_xact_summary;
-CREATE INDEX money_mat_summary_id_idx ON money.materialized_billable_xact_summary (id);
+ALTER TABLE money.materialized_billable_xact_summary ADD CONSTRAINT 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/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-08-02 15:00:51 UTC (rev 17061)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-08-02 17:17:55 UTC (rev 17062)
@@ -759,7 +759,7 @@
) INHERITS (config.remote_account);
-- We need a UNIQUE constraint here also, to support the FK from acq.provider.edi_default
-ALTER TABLE acq.edi_account ADD CONSTRAINT acq_edi_account_id_unique UNIQUE (id);
+ALTER TABLE acq.edi_account ADD CONSTRAINT PRIMARY KEY (id);
CREATE TABLE acq.edi_message (
id SERIAL PRIMARY KEY,
Added: 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 (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0356.schema.missing-pkey-constraints.sql 2010-08-02 17:17:55 UTC (rev 17062)
@@ -0,0 +1,14 @@
+BEGIN;
+
+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);
+
+DROP INDEX money.money_mat_summary_id_idx;
+ALTER TABLE money.materialized_billable_xact_summary ADD CONSTRAINT PRIMARY KEY (id);
+
+ALTER TABLE staging.billing_address_stage ADD CONSTRAINT PRIMARY KEY (row_id);
+
+COMMIT;
+
More information about the open-ils-commits
mailing list