0014_project_suspension.sql15 lines · main
| 1 | -- Project suspension state — populated by admin action (manual) or by |
| 2 | -- the abuse-report pipeline when a resolution lands as "suspended" or |
| 3 | -- "banned". A non-null suspended_at means: state-changing routes for |
| 4 | -- this project return 403 project_suspended; reads remain open so the |
| 5 | -- operator can investigate via the dashboard. See |
| 6 | -- apps/api/src/services/abuse.ts and middleware/project-suspended.ts |
| 7 | -- for the enforcement points. |
| 8 | |
| 9 | ALTER TABLE "projects" |
| 10 | ADD COLUMN IF NOT EXISTS "suspended_at" timestamp with time zone, |
| 11 | ADD COLUMN IF NOT EXISTS "suspend_reason" text; |
| 12 | |
| 13 | CREATE INDEX IF NOT EXISTS "projects_suspended_at_idx" |
| 14 | ON "projects" USING btree ("suspended_at") |
| 15 | WHERE "suspended_at" IS NOT NULL; |