Move to better sqlite3

This commit is contained in:
2026-03-07 12:34:04 +02:00
parent 0370930894
commit 926fc0fd0b
15 changed files with 10648 additions and 3213 deletions

View File

@@ -0,0 +1,28 @@
CREATE TABLE `preferences` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` numeric,
`data` text,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `preferences_user_id_unique` ON `preferences` (`user_id`);--> statement-breakpoint
CREATE TABLE `tokens` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` numeric,
`refresh_token` text,
`access_token` text,
`expires_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `tokens_user_id_unique` ON `tokens` (`user_id`);--> statement-breakpoint
CREATE TABLE `users` (
`id` numeric PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`avatar` text,
`city` text,
`country` text,
`sex` text,
`weight` integer,
`created_at` integer
);