mirror of
https://github.com/beilunyang/moemail.git
synced 2025-09-26 19:41:22 +08:00
13 lines
424 B
SQL
13 lines
424 B
SQL
CREATE TABLE `api_keys` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`user_id` text NOT NULL,
|
|
`name` text NOT NULL,
|
|
`key` text NOT NULL,
|
|
`created_at` integer,
|
|
`expires_at` integer,
|
|
`last_used_at` integer,
|
|
`enabled` integer DEFAULT true NOT NULL,
|
|
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `api_keys_key_unique` ON `api_keys` (`key`); |