gitdataai/libs/migrate/sql/m20260412_000001_create_workspace_billing.sql
ZhenYi 3a8b8c9cf8 remove all foreign key constraints from SQL migrations
Foreign keys at the database level cause issues with deployment flexibility.
Keep only indexes for query performance; enforce referential integrity at
the application level.
2026-04-15 11:03:17 +08:00

10 lines
421 B
SQL

CREATE TABLE IF NOT EXISTS workspace_billing (
workspace_id UUID PRIMARY KEY,
balance DECIMAL(20, 4) NOT NULL DEFAULT 0,
currency VARCHAR(10) NOT NULL DEFAULT 'USD',
monthly_quota DECIMAL(20, 4) NOT NULL DEFAULT 0,
total_spent DECIMAL(20, 4) NOT NULL DEFAULT 0,
updated_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL
);