Initial commit
This commit is contained in:
14
server/database/migrations/0001_spooky_gravity.sql
Normal file
14
server/database/migrations/0001_spooky_gravity.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
||||
CREATE TABLE `__new_tokens` (
|
||||
`id` integer PRIMARY KEY NOT NULL,
|
||||
`user_id` integer,
|
||||
`refresh_token` text,
|
||||
`access_token` text,
|
||||
`expires_at` integer NOT NULL,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
|
||||
);
|
||||
--> statement-breakpoint
|
||||
INSERT INTO `__new_tokens`("id", "user_id", "refresh_token", "access_token", "expires_at") SELECT "id", "user_id", "refresh_token", "access_token", "expires_at" FROM `tokens`;--> statement-breakpoint
|
||||
DROP TABLE `tokens`;--> statement-breakpoint
|
||||
ALTER TABLE `__new_tokens` RENAME TO `tokens`;--> statement-breakpoint
|
||||
PRAGMA foreign_keys=ON;
|
||||
Reference in New Issue
Block a user