* refactor: move migrations to new structure * refactor: convert all findMany to new structure * fix(backups-schedule): missing null matching for last backup status * chore: move root lib to server
12 lines
No EOL
621 B
SQL
12 lines
No EOL
621 B
SQL
CREATE TABLE `two_factor` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`secret` text NOT NULL,
|
|
`backup_codes` text NOT NULL,
|
|
`user_id` text NOT NULL,
|
|
FOREIGN KEY (`user_id`) REFERENCES `users_table`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `twoFactor_secret_idx` ON `two_factor` (`secret`);--> statement-breakpoint
|
|
CREATE INDEX `twoFactor_userId_idx` ON `two_factor` (`user_id`);--> statement-breakpoint
|
|
ALTER TABLE `users_table` ADD `two_factor_enabled` integer DEFAULT false NOT NULL;--> statement-breakpoint
|
|
CREATE INDEX `sessionsTable_userId_idx` ON `sessions_table` (`user_id`); |