~singpolyma/jmp-schemas

ref: 48bc71e185ca235f2192a2dbf6cb70dbd9de1aa1 jmp-schemas/deploy/cdr.sql -rw-r--r-- 474 bytes
48bc71e1Stephen Paul Weber sqitch tag 1 year, 6 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;