From: Bill Erickson Date: Thu, 25 Feb 2016 20:47:20 +0000 (-0500) Subject: LP#1206936 Base SQL schema repair X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1206936-base-schema-repair;p=working%2FEvergreen.git LP#1206936 Base SQL schema repair Avoid referencing money.materialized_billable_xact_summary before it's defined. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/080.schema.money.sql b/Open-ILS/src/sql/Pg/080.schema.money.sql index 19a88c7141..6265ae8da2 100644 --- a/Open-ILS/src/sql/Pg/080.schema.money.sql +++ b/Open-ILS/src/sql/Pg/080.schema.money.sql @@ -94,14 +94,6 @@ CREATE OR REPLACE VIEW money.transaction_billing_type_summary AS GROUP BY xact,billing_type ORDER BY MAX(billing_ts); -CREATE OR REPLACE VIEW money.transaction_billing_summary AS - SELECT id as xact, - last_billing_type, - last_billing_note, - last_billing_ts, - total_owed - FROM money.materialized_billable_xact_summary; - CREATE OR REPLACE VIEW money.transaction_payment_summary AS SELECT xact, @@ -263,6 +255,14 @@ 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); +CREATE OR REPLACE VIEW money.transaction_billing_summary AS + SELECT id as xact, + last_billing_type, + last_billing_note, + last_billing_ts, + total_owed + FROM money.materialized_billable_xact_summary; + /* AFTER trigger only! */ CREATE OR REPLACE FUNCTION money.mat_summary_create () RETURNS TRIGGER AS $$ BEGIN