mirror of
https://github.com/hexolan/stocklet.git
synced 2026-05-20 11:39:24 +01:00
chore: initial commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DROP TABLE IF EXISTS transactions CASCADE;
|
||||
DROP TABLE IF EXISTS customer_balances CASCADE;
|
||||
DROP TABLE IF EXISTS event_outbox CASCADE;
|
||||
@@ -0,0 +1,24 @@
|
||||
CREATE TABLE transactions (
|
||||
id bigserial PRIMARY KEY,
|
||||
|
||||
order_id varchar(64),
|
||||
customer_id varchar(64) NOT NULL,
|
||||
|
||||
amount money NOT NULL,
|
||||
|
||||
reversed_at timestamp,
|
||||
processed_at timestamp NOT NULL DEFAULT timezone('utc', now())
|
||||
);
|
||||
|
||||
CREATE TABLE customer_balances (
|
||||
customer_id varchar(64) PRIMARY KEY,
|
||||
balance money NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE event_outbox (
|
||||
id bigserial PRIMARY KEY,
|
||||
|
||||
aggregateid varchar(128) NOT NULL,
|
||||
aggregatetype varchar(128) NOT NULL,
|
||||
payload bytea NOT NULL
|
||||
);
|
||||
Reference in New Issue
Block a user