From 3262d631fd1be55a5c85ede08d92a35c5fb7d2c4 Mon Sep 17 00:00:00 2001
From: Mathias Magnusson <mathias@magnusson.space>
Date: Mon, 18 Aug 2025 21:43:11 +0200
Subject: Get current user session

---
 migrations/0002_red_morlun.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 migrations/0002_red_morlun.sql

(limited to 'migrations/0002_red_morlun.sql')

diff --git a/migrations/0002_red_morlun.sql b/migrations/0002_red_morlun.sql
new file mode 100644
index 0000000..23de4ce
--- /dev/null
+++ b/migrations/0002_red_morlun.sql
@@ -0,0 +1,13 @@
+PRAGMA foreign_keys=OFF;--> statement-breakpoint
+CREATE TABLE `__new_sessions` (
+	`id` integer PRIMARY KEY NOT NULL,
+	`uuid` text NOT NULL,
+	`user_id` integer NOT NULL,
+	`last_use` integer DEFAULT (unixepoch()) NOT NULL
+);
+--> statement-breakpoint
+INSERT INTO `__new_sessions`("id", "uuid", "user_id", "last_use") SELECT "id", "uuid", "user_id", "last_use" FROM `sessions`;--> statement-breakpoint
+DROP TABLE `sessions`;--> statement-breakpoint
+ALTER TABLE `__new_sessions` RENAME TO `sessions`;--> statement-breakpoint
+PRAGMA foreign_keys=ON;--> statement-breakpoint
+CREATE UNIQUE INDEX `sessions_uuid_unique` ON `sessions` (`uuid`);
\ No newline at end of file
-- 
cgit v1.2.3

