mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-15 06:47:44 +02:00
51 lines
1.6 KiB
SQL
51 lines
1.6 KiB
SQL
CREATE TABLE `account` (
|
|
`id` text PRIMARY KEY,
|
|
`account_id` text NOT NULL,
|
|
`provider_id` text NOT NULL,
|
|
`user_id` text NOT NULL,
|
|
`access_token` text,
|
|
`refresh_token` text,
|
|
`id_token` text,
|
|
`access_token_expires_at` integer,
|
|
`refresh_token_expires_at` integer,
|
|
`scope` text,
|
|
`password` text,
|
|
`created_at` integer NOT NULL,
|
|
`updated_at` integer NOT NULL,
|
|
CONSTRAINT `fk_account_user_id_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `session` (
|
|
`id` text PRIMARY KEY,
|
|
`expires_at` integer NOT NULL,
|
|
`token` text NOT NULL UNIQUE,
|
|
`created_at` integer NOT NULL,
|
|
`updated_at` integer NOT NULL,
|
|
`ip_address` text,
|
|
`user_agent` text,
|
|
`user_id` text NOT NULL,
|
|
CONSTRAINT `fk_session_user_id_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `user` (
|
|
`id` text PRIMARY KEY,
|
|
`name` text NOT NULL,
|
|
`email` text NOT NULL UNIQUE,
|
|
`email_verified` integer DEFAULT false NOT NULL,
|
|
`image` text,
|
|
`created_at` integer NOT NULL,
|
|
`updated_at` integer NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `verification` (
|
|
`id` text PRIMARY KEY,
|
|
`identifier` text NOT NULL,
|
|
`value` text NOT NULL,
|
|
`expires_at` integer NOT NULL,
|
|
`created_at` integer NOT NULL,
|
|
`updated_at` integer NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `account_userId_idx` ON `account` (`user_id`);--> statement-breakpoint
|
|
CREATE INDEX `session_userId_idx` ON `session` (`user_id`);--> statement-breakpoint
|
|
CREATE INDEX `verification_identifier_idx` ON `verification` (`identifier`);
|