Files
expenses/server/migrations/20260919000000_create_transactions.sql
T

7 lines
281 B
SQL

CREATE TABLE transactions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
description TEXT NOT NULL,
amount_cents BIGINT NOT NULL CHECK (amount_cents >= 0),
direction TEXT NOT NULL CHECK (direction IN ('in', 'out')),
date TIMESTAMPTZ NOT NULL DEFAULT now()
);