dashore-incubator/drizzle/0000_flawless_paladin.sql
Nicholai 6e7ed3634b feat(wishlist): add infrastructure wishlist page
- add D1 database with drizzle ORM for wishlist data
- create wishlist items, votes, and comments tables
- implement server actions for CRUD, voting, comments
- add wishlist page with auth protection
- create components: stats, filters, item cards, add dialog, detail drawer
- add optimistic updates for voting
- update sidebar navigation with Infrastructure Wishlist link
- configure middleware to use WORKOS_REDIRECT_URI env var for local dev
2026-01-22 00:19:46 -07:00

31 lines
907 B
SQL

CREATE TABLE `wishlist_comments` (
`id` text PRIMARY KEY NOT NULL,
`item_id` text NOT NULL,
`user_id` text NOT NULL,
`user_name` text NOT NULL,
`content` text NOT NULL,
`created_at` text NOT NULL,
FOREIGN KEY (`item_id`) REFERENCES `wishlist_items`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `wishlist_items` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`description` text NOT NULL,
`category` text NOT NULL,
`priority` text NOT NULL,
`estimated_cost` real,
`link` text,
`submitted_by` text NOT NULL,
`submitted_by_name` text NOT NULL,
`created_at` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `wishlist_votes` (
`id` text PRIMARY KEY NOT NULL,
`item_id` text NOT NULL,
`user_id` text NOT NULL,
`created_at` text NOT NULL,
FOREIGN KEY (`item_id`) REFERENCES `wishlist_items`(`id`) ON UPDATE no action ON DELETE cascade
);