~singpolyma/jmp-schemas

543d618e33054369ae897252ba58242fb6f6a8dd — Stephen Paul Weber 3 years ago 583a6f7
Store plans data in a table

Ideally this would come via FDW, but for now we can easily have a script push to
this table from the source of truth.
4 files changed, 24 insertions(+), 0 deletions(-)

A deploy/plans.sql
A revert/plans.sql
M sqitch.plan
A verify/plans.sql
A deploy/plans.sql => deploy/plans.sql +9 -0
@@ 0,0 1,9 @@
-- Deploy jmp:plans to pg

BEGIN;

CREATE TABLE plans (
	plan JSONB NOT NULL
);

COMMIT;

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

BEGIN;

DROP TABLE plans;

COMMIT;

M sqitch.plan => sqitch.plan +1 -0
@@ 17,3 17,4 @@ unused_invites 2021-05-17T20:40:20Z Stephen Paul Weber,,, <singpolyma@singpolyma
invite_per_15 [transactions invites] 2021-08-18T17:46:38Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # $15 gives you an invite code
call_rates 2021-11-17T01:29:07Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Table to store per-plan per-direction rates to different prefixes
cdr_with_charge [cdr call_rates customer_plans] 2021-11-17T01:44:14Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # View to get CDR records augmented with rate and charge amount
plans 2021-11-17T18:06:30Z Stephen Paul Weber,,, <singpolyma@singpolyma-beefy> # Table for plan metadata\n\nIdeally this would come from a dhall_fdw, but for now we can import to this.

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

BEGIN;

SELECT plan FROM plans;

ROLLBACK;