~singpolyma/jmp-schemas

8dc0819636bdc2563da78d0f2381c7c9f42d2827 — Stephen Paul Weber 2 months ago a855f8f
Add settled_after to transactions table
4 files changed, 28 insertions(+), 0 deletions(-)

A deploy/settled_after.sql
A revert/settled_after.sql
M sqitch.plan
A verify/settled_after.sql
A deploy/settled_after.sql => deploy/settled_after.sql +12 -0
@@ 0,0 1,12 @@
-- Deploy jmp:settled_after to pg
-- requires: transactions

BEGIN;

-- Allow NULL for now until all code is generating the value
-- and all data has been updated, then do a change to make it NOT NULL later

ALTER TABLE transactions
ADD COLUMN settled_after TIMESTAMP;

COMMIT;

A revert/settled_after.sql => revert/settled_after.sql +7 -0
@@ 0,0 1,7 @@
-- Revert jmp:settled_after from pg

BEGIN;

ALTER TABLE transactions DROP COLUMN settled_after;

COMMIT;

M sqitch.plan => sqitch.plan +2 -0
@@ 32,3 32,5 @@ cdr_with_charge_rate_when_no_plan [cdr_with_charge_faster] 2022-02-09T01:55:13Z 

invites_rewarded_at [invites] 2022-02-22T16:54:33Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Add rewarded_at to invites so we can track rewards\n\nNeed this because we don't reward right at use, but later after they have paid.
@2022075 2022-03-16T14:08:42Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # invites.rewarded_at

settled_after [transactions] 2022-04-11T17:34:18Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Consider transactions settled after some time

A verify/settled_after.sql => verify/settled_after.sql +7 -0
@@ 0,0 1,7 @@
-- Verify jmp:settled_after on pg

BEGIN;

SELECT settled_after FROM transactions;

ROLLBACK;