|
| 1 | +CREATE TABLE `account` ( |
| 2 | + `id` text PRIMARY KEY NOT NULL, |
| 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 | + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade |
| 16 | +); |
| 17 | +--> statement-breakpoint |
| 18 | +CREATE TABLE `session` ( |
| 19 | + `id` text PRIMARY KEY NOT NULL, |
| 20 | + `expires_at` integer NOT NULL, |
| 21 | + `token` text NOT NULL, |
| 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 | + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade |
| 28 | +); |
| 29 | +--> statement-breakpoint |
| 30 | +CREATE UNIQUE INDEX `session_token_unique` ON `session` (`token`);--> statement-breakpoint |
| 31 | +CREATE TABLE `user` ( |
| 32 | + `id` text PRIMARY KEY NOT NULL, |
| 33 | + `name` text NOT NULL, |
| 34 | + `email` text NOT NULL, |
| 35 | + `email_verified` integer NOT NULL, |
| 36 | + `image` text, |
| 37 | + `created_at` integer NOT NULL, |
| 38 | + `updated_at` integer NOT NULL |
| 39 | +); |
| 40 | +--> statement-breakpoint |
| 41 | +CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint |
| 42 | +CREATE TABLE `verification` ( |
| 43 | + `id` text PRIMARY KEY NOT NULL, |
| 44 | + `identifier` text NOT NULL, |
| 45 | + `value` text NOT NULL, |
| 46 | + `expires_at` integer NOT NULL, |
| 47 | + `created_at` integer, |
| 48 | + `updated_at` integer |
| 49 | +); |
0 commit comments