~singpolyma/jmp-schemas

ref: bd52ab015968f1480226210aeb097f3347f280bd jmp-schemas/deploy/transactions.sql -rw-r--r-- 321 bytes
bd52ab01Stephen Paul Weber Create the transactions table 1 year, 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Deploy jmp:transactions to pg

BEGIN;

CREATE TABLE transactions (
	customer_id    TEXT          NOT NULL,
	transaction_id TEXT          PRIMARY KEY,
	created_at     timestamp     NOT NULL DEFAULT(NOW()),
	amount         NUMERIC(12,2) NOT NULL
);

CREATE INDEX ON transactions (customer_id, created_at DESC);

COMMIT;