CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
0077_discussion_categories.sql
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| c645a86 | 1 | -- Gluecron migration 0077: Discussion categories table. |
| 2 | -- | |
| 3 | -- Adds per-repo discussion_categories so discussions can be organised into | |
| 4 | -- named buckets (General, Q&A, Announcements, Ideas) rather than relying on | |
| 5 | -- a bare text enum. The existing discussions.category text column is kept for | |
| 6 | -- backwards-compatibility; new code reads categories from this table. | |
| 7 | -- | |
| 8 | -- is_answerable = true means the category surfaces a "Mark as answer" button | |
| 9 | -- (GitHub's Q&A category behaviour). | |
| 10 | ||
| 11 | --> statement-breakpoint | |
| 12 | CREATE TABLE IF NOT EXISTS "discussion_categories" ( | |
| 13 | "id" serial PRIMARY KEY NOT NULL, | |
| 14 | "repository_id" uuid NOT NULL, | |
| 15 | "name" text NOT NULL, | |
| 16 | "emoji" text NOT NULL DEFAULT '💬', | |
| 17 | "description" text, | |
| 18 | "is_answerable" boolean NOT NULL DEFAULT false, | |
| 19 | CONSTRAINT "discussion_categories_repo_fk" FOREIGN KEY ("repository_id") | |
| 20 | REFERENCES "repositories"("id") ON DELETE CASCADE | |
| 21 | ); | |
| 22 | ||
| 23 | --> statement-breakpoint | |
| 24 | CREATE INDEX IF NOT EXISTS "discussion_categories_repo" | |
| 25 | ON "discussion_categories" ("repository_id"); |