feat: savings allocations
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m31s

This commit is contained in:
juancwu 2026-05-04 03:19:36 +00:00
commit 2dac136049
17 changed files with 1140 additions and 4 deletions

View file

@ -0,0 +1,21 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE allocations (
id TEXT PRIMARY KEY NOT NULL,
account_id TEXT NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
name TEXT NOT NULL,
amount TEXT NOT NULL,
target_amount TEXT,
sort_order INTEGER NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (account_id, name)
);
CREATE INDEX idx_allocations_account_id ON allocations (account_id, sort_order);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE allocations;
-- +goose StatementEnd