Move to sqlite off cloud
This commit is contained in:
28
server/database/migrations/0000_living_oracle.sql
Normal file
28
server/database/migrations/0000_living_oracle.sql
Normal 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 NOT NULL
|
||||
);
|
||||
Reference in New Issue
Block a user