| 1 | CREATE TABLE `account` ( |
| 2 | 	`id` text PRIMARY KEY, |
| 3 | 	`account_id` text NOT NULL, |
| 4 | 	`provider_id` text NOT NULL, |
| 5 | 	`user_id` text NOT NULL, |
| 6 | 	`access_token` text, |
| 7 | 	`refresh_token` text, |
| 8 | 	`id_token` text, |
| 9 | 	`access_token_expires_at` integer, |
| 10 | 	`refresh_token_expires_at` integer, |
| 11 | 	`scope` text, |
| 12 | 	`password` text, |
| 13 | 	`created_at` integer NOT NULL, |
| 14 | 	`updated_at` integer NOT NULL, |
| 15 | 	CONSTRAINT `fk_account_user_id_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE |
| 16 | ); |
| 17 | --> statement-breakpoint |
| 18 | CREATE TABLE `session` ( |
| 19 | 	`id` text PRIMARY KEY, |
| 20 | 	`expires_at` integer NOT NULL, |
| 21 | 	`token` text NOT NULL UNIQUE, |
| 22 | 	`created_at` integer NOT NULL, |
| 23 | 	`updated_at` integer NOT NULL, |
| 24 | 	`ip_address` text, |
| 25 | 	`user_agent` text, |
| 26 | 	`user_id` text NOT NULL, |
| 27 | 	CONSTRAINT `fk_session_user_id_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE |
| 28 | ); |
| 29 | --> statement-breakpoint |
| 30 | CREATE TABLE `user` ( |
| 31 | 	`id` text PRIMARY KEY, |
| 32 | 	`name` text NOT NULL, |
| 33 | 	`email` text NOT NULL UNIQUE, |
| 34 | 	`email_verified` integer DEFAULT false NOT NULL, |
| 35 | 	`image` text, |
| 36 | 	`created_at` integer NOT NULL, |
| 37 | 	`updated_at` integer NOT NULL |
| 38 | ); |
| 39 | --> statement-breakpoint |
| 40 | CREATE TABLE `verification` ( |
| 41 | 	`id` text PRIMARY KEY, |
| 42 | 	`identifier` text NOT NULL, |
| 43 | 	`value` text NOT NULL, |
| 44 | 	`expires_at` integer NOT NULL, |
| 45 | 	`created_at` integer NOT NULL, |
| 46 | 	`updated_at` integer NOT NULL |
| 47 | ); |
| 48 | --> statement-breakpoint |
| 49 | CREATE INDEX `account_userId_idx` ON `account` (`user_id`);--> statement-breakpoint |
| 50 | CREATE INDEX `session_userId_idx` ON `session` (`user_id`);--> statement-breakpoint |
| 51 | CREATE INDEX `verification_identifier_idx` ON `verification` (`identifier`); |