A deploy/cdr.sql => deploy/cdr.sql +19 -0
@@ 0,0 1,19 @@
+-- Deploy jmp:cdr to pg
+
+BEGIN;
+
+CREATE TYPE call_direction AS ENUM ('inbound', 'outbound');
+
+CREATE TABLE cdr (
+ cdr_id TEXT PRIMARY KEY,
+ customer_id TEXT NOT NULL,
+ start TIMESTAMP NOT NULL,
+ billsec INTEGER NOT NULL,
+ disposition TEXT NOT NULL,
+ tel TEXT NOT NULL, -- source or destination
+ direction call_direction NOT NULL DEFAULT('outbound')
+);
+
+CREATE INDEX ON cdr (customer_id);
+
+COMMIT;
A revert/cdr.sql => revert/cdr.sql +7 -0
@@ 0,0 1,7 @@
+-- Revert jmp:cdr from pg
+
+BEGIN;
+
+DROP TABLE cdr;
+
+COMMIT;
M sqitch.plan => sqitch.plan +1 -0
@@ 6,3 6,4 @@ balances 2021-02-23T15:08:09Z Stephen Paul Weber <singpolyma@singpolyma.net> # C
sub_cent_transactions 2021-02-24T01:37:35Z Stephen Paul Weber <singpolyma@singpolyma.net> # Minutes cost less than 1 cent, so we need more decimal places
plan_log 2021-02-24T01:53:29Z Stephen Paul Weber <singpolyma@singpolyma.net> # Log to show what plans an account has had
customer_plans 2021-02-24T02:06:25Z Stephen Paul Weber <singpolyma@singpolyma.net> # View of current customer plans
+cdr 2021-02-24T18:36:49Z Stephen Paul Weber <singpolyma@singpolyma.net> # Create CDR table for Asterisk
A verify/cdr.sql => verify/cdr.sql +15 -0
@@ 0,0 1,15 @@
+-- Verify jmp:cdr on pg
+
+BEGIN;
+
+SELECT
+ cdr_id,
+ customer_id,
+ start,
+ billsec,
+ disposition,
+ tel,
+ direction
+FROM cdr;
+
+ROLLBACK;