Skip to main content

max / makenotwork

448 B · 9 lines History Blame Raw
1 -- Sandbox accounts: ephemeral creator accounts for exploring the dashboard.
2 -- Sandbox users are real rows with is_sandbox = TRUE, auto-deleted after expiry.
3
4 ALTER TABLE users ADD COLUMN is_sandbox BOOLEAN NOT NULL DEFAULT FALSE;
5 ALTER TABLE users ADD COLUMN sandbox_expires_at TIMESTAMPTZ;
6
7 -- Partial index for the cleanup query (only sandbox rows).
8 CREATE INDEX idx_users_sandbox_expires ON users (sandbox_expires_at) WHERE is_sandbox = TRUE;
9