reimplemented auth
This commit is contained in:
parent
c925697c46
commit
2a6875016e
35 changed files with 906 additions and 233 deletions
20
drizzle/0000_gigantic_namorita.sql
Normal file
20
drizzle/0000_gigantic_namorita.sql
Normal file
|
@ -0,0 +1,20 @@
|
|||
CREATE TABLE `user_sessions` (
|
||||
`token` text PRIMARY KEY NOT NULL,
|
||||
`user_id` text NOT NULL,
|
||||
`max_age` integer NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch('subsec') * 1000) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch('subsec') * 1000) NOT NULL,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `user_sessions_token_unique` ON `user_sessions` (`token`);--> statement-breakpoint
|
||||
CREATE TABLE `users` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`hash` text NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch('subsec') * 1000) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch('subsec') * 1000) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);
|
Loading…
Add table
Add a link
Reference in a new issue