~singpolyma/jmp-schemas

ref: 240b3444466fb458b517d84c83bd6a782a21934e jmp-schemas/deploy/cdr.sql -rw-r--r-- 474 bytes
240b3444Stephen Paul Weber NOTIFY on low balance 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;