~singpolyma/jmp-schemas

bd52ab015968f1480226210aeb097f3347f280bd — Stephen Paul Weber 1 year, 2 months ago 18143fe
Create the transactions table
4 files changed, 35 insertions(+), 0 deletions(-)

A deploy/transactions.sql
A revert/transactions.sql
M sqitch.plan
A verify/transactions.sql
A deploy/transactions.sql => deploy/transactions.sql +14 -0
@@ 0,0 1,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;

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

BEGIN;

DROP TABLE transactions;

COMMIT;

M sqitch.plan => sqitch.plan +1 -0
@@ 1,3 1,4 @@
%syntax-version=1.0.0
%project=jmp

transactions 2021-02-22T19:15:25Z Stephen Paul Weber <singpolyma@singpolyma.net> # Creates a table to track user's transactions

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

BEGIN;

SELECT
	customer_id,
	transaction_id,
	created_at,
	amount
FROM transactions
WHERE FALSE;

ROLLBACK;