From 75d315dda4232ee3b89abf054f0b6ee10105ffe3 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 1 Mar 2024 18:00:58 +0000
Subject: feature: Add support for creating and updating lists

---
 packages/db/drizzle/0002_worried_beyonder.sql | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 packages/db/drizzle/0002_worried_beyonder.sql

(limited to 'packages/db/drizzle/0002_worried_beyonder.sql')

diff --git a/packages/db/drizzle/0002_worried_beyonder.sql b/packages/db/drizzle/0002_worried_beyonder.sql
new file mode 100644
index 00000000..a3cd989d
--- /dev/null
+++ b/packages/db/drizzle/0002_worried_beyonder.sql
@@ -0,0 +1,19 @@
+CREATE TABLE `bookmarkLists` (
+	`id` text PRIMARY KEY NOT NULL,
+	`name` text NOT NULL,
+	`icon` text NOT NULL,
+	`createdAt` integer NOT NULL,
+	`userId` text NOT NULL,
+	FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE TABLE `bookmarksInLists` (
+	`bookmarkId` text NOT NULL,
+	`listId` text NOT NULL,
+	`addedAt` integer,
+	PRIMARY KEY(`bookmarkId`, `listId`),
+	FOREIGN KEY (`bookmarkId`) REFERENCES `bookmarks`(`id`) ON UPDATE no action ON DELETE cascade,
+	FOREIGN KEY (`listId`) REFERENCES `bookmarkLists`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `bookmarkLists_name_userId_unique` ON `bookmarkLists` (`name`,`userId`);
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

