Files
moemail/drizzle/0009_overconfident_gateway.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`);