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,
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(),
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);
) 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,
--- /dev/null
+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;
+