CREATE TABLE money.aged_billing (LIKE money.billing INCLUDING INDEXES);
+
+/* LP 1858448 : Disable initial aged money migration
+
INSERT INTO money.aged_payment
SELECT mp.* FROM money.payment_view mp
JOIN action.aged_circulation circ ON (circ.id = mp.xact);
INSERT INTO money.aged_billing
SELECT mb.* FROM money.billing mb
JOIN action.aged_circulation circ ON (circ.id = mb.xact);
+*/
CREATE OR REPLACE VIEW money.all_payments AS
SELECT * FROM money.payment_view
-- Migrate billings and payments to aged tables
+
+/* LP 1858448 : Disable initial aged money migration
INSERT INTO money.aged_billing
SELECT * FROM money.billing WHERE xact = OLD.id;
DELETE FROM money.payment WHERE xact = OLD.id;
DELETE FROM money.billing WHERE xact = OLD.id;
+*/
RETURN OLD;
END;
$$ LANGUAGE 'plpgsql';
+
+/* LP 1858448 : Disable initial aged money migration
+
-- NOTE you could COMMIT here then start a new TRANSACTION if desired.
\qecho Deleting aged payments and billings from active payment/billing
ADD CONSTRAINT account_adjustment_billing_fkey
FOREIGN KEY (billing) REFERENCES money.billing (id);
+*/
+
COMMIT;
-- Good to run after truncating -- OK to run after COMMIT.
+/* LP 1858448 : Disable initial aged money migration
ANALYZE money.billing;
+*/
-- Migrate billings and payments to aged tables
+
+/* LP 1858448 : Disable initial aged money migration
INSERT INTO money.aged_billing
SELECT * FROM money.billing WHERE xact = OLD.id;
DELETE FROM money.payment WHERE xact = OLD.id;
DELETE FROM money.billing WHERE xact = OLD.id;
+*/
+
RETURN OLD;
END;
$$ LANGUAGE 'plpgsql';
CREATE TABLE money.aged_billing (LIKE money.billing INCLUDING INDEXES);
+
+/* LP 1858448 : Disable initial aged money migration
+
INSERT INTO money.aged_payment
SELECT mp.* FROM money.payment_view mp
JOIN action.aged_circulation circ ON (circ.id = mp.xact);
SELECT mb.* FROM money.billing mb
JOIN action.aged_circulation circ ON (circ.id = mb.xact);
+*/
+
CREATE OR REPLACE VIEW money.all_payments AS
SELECT * FROM money.payment_view
UNION ALL
-- Migrate billings and payments to aged tables
+/* LP 1858448 : Disable initial aged money migration
INSERT INTO money.aged_billing
SELECT * FROM money.billing WHERE xact = OLD.id;
DELETE FROM money.payment WHERE xact = OLD.id;
DELETE FROM money.billing WHERE xact = OLD.id;
+*/
RETURN OLD;
END;
$$ LANGUAGE 'plpgsql';
+
+/* LP 1858448 : Disable initial aged money migration
+
-- NOTE you could COMMIT here then start a new TRANSACTION if desired.
\qecho Deleting aged payments and billings from active payment/billing
-- Good to run after truncating -- OK to run after COMMIT.
ANALYZE money.billing;
+*/
+
SELECT evergreen.upgrade_deps_block_check('1182', :eg_version);
-- Migrate billings and payments to aged tables
+/* LP 1858448 : Disable initial aged money migration
INSERT INTO money.aged_billing
SELECT * FROM money.billing WHERE xact = OLD.id;
DELETE FROM money.payment WHERE xact = OLD.id;
DELETE FROM money.billing WHERE xact = OLD.id;
+*/
RETURN OLD;
END;