From 88c4035bc0c716ba03e10da760253da0aefe7b60 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 3 Aug 2025 08:57:04 -0700
Subject: fix: Get rid of the userSetting table completely

---
 packages/db/drizzle/0061_merge_user_settings.sql | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 packages/db/drizzle/0061_merge_user_settings.sql

(limited to 'packages/db/drizzle/0061_merge_user_settings.sql')

diff --git a/packages/db/drizzle/0061_merge_user_settings.sql b/packages/db/drizzle/0061_merge_user_settings.sql
new file mode 100644
index 00000000..46c11739
--- /dev/null
+++ b/packages/db/drizzle/0061_merge_user_settings.sql
@@ -0,0 +1,14 @@
+ALTER TABLE `user` ADD `bookmarkClickAction` text DEFAULT 'open_original_link' NOT NULL;--> statement-breakpoint
+ALTER TABLE `user` ADD `archiveDisplayBehaviour` text DEFAULT 'show' NOT NULL;--> statement-breakpoint
+ALTER TABLE `user` ADD `timezone` text DEFAULT 'UTC';--> statement-breakpoint
+UPDATE `user` SET
+  `bookmarkClickAction` = (
+    SELECT `bookmarkClickAction` FROM `userSettings` WHERE `userSettings`.`userId` = `user`.`id`
+  ),
+  `archiveDisplayBehaviour` = (
+    SELECT `archiveDisplayBehaviour` FROM `userSettings` WHERE `userSettings`.`userId` = `user`.`id`
+  ),
+  `timezone` = (
+    SELECT `timezone` FROM `userSettings` WHERE `userSettings`.`userId` = `user`.`id`
+  );--> statement-breakpoint
+DROP TABLE `userSettings`;
-- 
cgit v1.2.3-70-g09d2

