From cf1a25131fd45ab7c9a72b837be525c24457cd8b Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 3 Nov 2024 17:09:47 +0000
Subject: feature: Add support for subscribing to RSS feeds. Fixes #202

---
 packages/db/drizzle/0032_futuristic_shiva.sql | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 packages/db/drizzle/0032_futuristic_shiva.sql

(limited to 'packages/db/drizzle/0032_futuristic_shiva.sql')

diff --git a/packages/db/drizzle/0032_futuristic_shiva.sql b/packages/db/drizzle/0032_futuristic_shiva.sql
new file mode 100644
index 00000000..4bb79426
--- /dev/null
+++ b/packages/db/drizzle/0032_futuristic_shiva.sql
@@ -0,0 +1,25 @@
+CREATE TABLE `rssFeedImports` (
+	`id` text PRIMARY KEY NOT NULL,
+	`createdAt` integer NOT NULL,
+	`entryId` text NOT NULL,
+	`rssFeedId` text NOT NULL,
+	`bookmarkId` text,
+	FOREIGN KEY (`rssFeedId`) REFERENCES `rssFeeds`(`id`) ON UPDATE no action ON DELETE cascade,
+	FOREIGN KEY (`bookmarkId`) REFERENCES `bookmarks`(`id`) ON UPDATE no action ON DELETE set null
+);
+--> statement-breakpoint
+CREATE TABLE `rssFeeds` (
+	`id` text PRIMARY KEY NOT NULL,
+	`name` text NOT NULL,
+	`url` text NOT NULL,
+	`createdAt` integer NOT NULL,
+	`lastFetchedAt` integer,
+	`lastFetchedStatus` text DEFAULT 'pending',
+	`userId` text NOT NULL,
+	FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+CREATE INDEX `rssFeedImports_feedIdIdx_idx` ON `rssFeedImports` (`rssFeedId`);--> statement-breakpoint
+CREATE INDEX `rssFeedImports_entryIdIdx_idx` ON `rssFeedImports` (`entryId`);--> statement-breakpoint
+CREATE UNIQUE INDEX `rssFeedImports_rssFeedId_entryId_unique` ON `rssFeedImports` (`rssFeedId`,`entryId`);--> statement-breakpoint
+CREATE INDEX `rssFeeds_userId_idx` ON `rssFeeds` (`userId`);
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

