ci / lint-test (push) Successful in 43s
- prisma/migrations/0011_trips: trips table, trip_id on overrides, partial index — idempotent; matches DDL already applied to prod. Applied to personal_test (integration suite was failing on missing trips relation). - README/CLAUDE.md: deployment is now push-to-deploy via Komodo (deploy-finance Procedure, Gitea webhook); compose command is fallback. - README: migrations table completed through 0011; note that the container must only be reachable via Traefik (header-trust auth).
22 lines
847 B
SQL
22 lines
847 B
SQL
-- Trips: group transactions (via transaction_overrides.trip_id) into named
|
|
-- trips with analytics. Catch-up migration — this DDL was applied directly to
|
|
-- the live DB when the feature shipped; idempotent so re-running is safe.
|
|
|
|
CREATE TABLE IF NOT EXISTS trips (
|
|
id SERIAL PRIMARY KEY,
|
|
owner_id INTEGER NOT NULL REFERENCES participants(id),
|
|
name VARCHAR(255) NOT NULL,
|
|
description TEXT,
|
|
start_date DATE,
|
|
end_date DATE,
|
|
color VARCHAR(20) NOT NULL DEFAULT '#6366f1',
|
|
archived BOOLEAN NOT NULL DEFAULT false,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
ALTER TABLE transaction_overrides
|
|
ADD COLUMN IF NOT EXISTS trip_id INTEGER REFERENCES trips(id) ON DELETE SET NULL;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tx_overrides_trip_id
|
|
ON transaction_overrides (trip_id) WHERE trip_id IS NOT NULL;
|