Files
deckyvault/apps/web/drizzle/0009_flawless_meltdown.sql
adrianbonpin cd72b7a948 refactor: convert to bun workspaces monorepo
- Move web app into apps/web/
- Create packages/shared/ with shared types
- Create plugins/decky-vault/ scaffold
- Root package.json manages workspaces only
2026-06-28 05:20:28 +08:00

15 lines
1.0 KiB
SQL

CREATE TYPE "public"."report_reason" AS ENUM('inaccurate', 'spam', 'inappropriate', 'other');--> statement-breakpoint
CREATE TYPE "public"."report_status" AS ENUM('open', 'reviewed', 'dismissed');--> statement-breakpoint
CREATE TABLE "reports" (
"id" text PRIMARY KEY NOT NULL,
"entry_id" text NOT NULL,
"reporter_id" text NOT NULL,
"reason" "report_reason" NOT NULL,
"details" text,
"status" "report_status" DEFAULT 'open' NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "reports" ADD CONSTRAINT "reports_entry_id_performance_entries_id_fk" FOREIGN KEY ("entry_id") REFERENCES "public"."performance_entries"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "reports" ADD CONSTRAINT "reports_reporter_id_user_id_fk" FOREIGN KEY ("reporter_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "reports_entry_reporter_unique" ON "reports" USING btree ("entry_id","reporter_id");