dashore-incubator/drizzle/0001_modern_mad_thinker.sql
Nicholai ecbc9c627d feat(wishlist): add comment delete, voting, and replies
- Add parentId column to wishlist_comments for reply threading
- Create wishlist_comment_votes table for up/down voting
- Add deleteComment action (owner-only, cascades to replies)
- Add toggleCommentVote action with toggle behavior
- Update getItemWithComments to return nested CommentWithMeta
- Create CommentItem component with voting UI and reply support
- One level of reply depth enforced (can't reply to replies)
2026-01-22 03:18:10 -07:00

10 lines
369 B
SQL

CREATE TABLE `wishlist_comment_votes` (
`id` text PRIMARY KEY NOT NULL,
`comment_id` text NOT NULL,
`user_id` text NOT NULL,
`vote_type` text NOT NULL,
`created_at` text NOT NULL,
FOREIGN KEY (`comment_id`) REFERENCES `wishlist_comments`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
ALTER TABLE `wishlist_comments` ADD `parent_id` text;