- Add watchlist feature: eye icon per participant, "Watched Only" filter, DB table + migration, toggle API route, socket sync on reconnect - Make RecentPicksFeed collapsible on mobile participants tab (chevron toggle, defaults expanded) - Add AutodraftSettings to mobile controls tab (was desktop-only) - Pin Pause/Resume Draft and Exit Draft Room buttons to the bottom of the mobile controls tab Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
No EOL
1.2 KiB
SQL
27 lines
No EOL
1.2 KiB
SQL
CREATE TABLE IF NOT EXISTS "watchlist" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"season_id" uuid NOT NULL,
|
|
"team_id" uuid NOT NULL,
|
|
"participant_id" uuid NOT NULL,
|
|
"created_at" timestamp DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
DO $$ BEGIN
|
|
ALTER TABLE "watchlist" ADD CONSTRAINT "watchlist_season_id_seasons_id_fk" FOREIGN KEY ("season_id") REFERENCES "public"."seasons"("id") ON DELETE cascade ON UPDATE no action;
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN null;
|
|
END $$;
|
|
--> statement-breakpoint
|
|
DO $$ BEGIN
|
|
ALTER TABLE "watchlist" ADD CONSTRAINT "watchlist_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "public"."teams"("id") ON DELETE cascade ON UPDATE no action;
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN null;
|
|
END $$;
|
|
--> statement-breakpoint
|
|
DO $$ BEGIN
|
|
ALTER TABLE "watchlist" ADD CONSTRAINT "watchlist_participant_id_participants_id_fk" FOREIGN KEY ("participant_id") REFERENCES "public"."participants"("id") ON DELETE cascade ON UPDATE no action;
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN null;
|
|
END $$;
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX IF NOT EXISTS "watchlist_season_team_participant_unique" ON "watchlist" USING btree ("season_id","team_id","participant_id"); |