summaryrefslogtreecommitdiff
path: root/migrations/0001_funny_ronan.sql
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-08-18 21:43:11 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-08-18 21:43:11 +0200
commit3262d631fd1be55a5c85ede08d92a35c5fb7d2c4 (patch)
treefb2a09e159dc8677b7587cba8d4c69c4b1b70d8e /migrations/0001_funny_ronan.sql
parent815de9906a014c2eb1a4fe2bd8cf1b3077f03c9c (diff)
downloaduneven-3262d631fd1be55a5c85ede08d92a35c5fb7d2c4.tar.gz
Get current user session
Diffstat (limited to 'migrations/0001_funny_ronan.sql')
-rw-r--r--migrations/0001_funny_ronan.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/migrations/0001_funny_ronan.sql b/migrations/0001_funny_ronan.sql
new file mode 100644
index 0000000..9928b60
--- /dev/null
+++ b/migrations/0001_funny_ronan.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 current_timestamp 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