feat: add OAuth tables (clients, codes, tokens) to schema
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
33
drizzle/0009_happy_mockingbird.sql
Normal file
33
drizzle/0009_happy_mockingbird.sql
Normal file
@@ -0,0 +1,33 @@
|
||||
CREATE TABLE `oauth_clients` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`client_id` text NOT NULL,
|
||||
`client_name` text,
|
||||
`redirect_uris` text NOT NULL,
|
||||
`created_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `oauth_clients_client_id_unique` ON `oauth_clients` (`client_id`);--> statement-breakpoint
|
||||
CREATE TABLE `oauth_codes` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`code` text NOT NULL,
|
||||
`client_id` text NOT NULL,
|
||||
`code_challenge` text NOT NULL,
|
||||
`code_challenge_method` text DEFAULT 'S256' NOT NULL,
|
||||
`redirect_uri` text NOT NULL,
|
||||
`expires_at` integer NOT NULL,
|
||||
`used` integer DEFAULT 0 NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `oauth_codes_code_unique` ON `oauth_codes` (`code`);--> statement-breakpoint
|
||||
CREATE TABLE `oauth_tokens` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`access_token_hash` text NOT NULL,
|
||||
`refresh_token_hash` text NOT NULL,
|
||||
`client_id` text NOT NULL,
|
||||
`expires_at` integer NOT NULL,
|
||||
`refresh_expires_at` integer NOT NULL,
|
||||
`created_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `oauth_tokens_access_token_hash_unique` ON `oauth_tokens` (`access_token_hash`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `oauth_tokens_refresh_token_hash_unique` ON `oauth_tokens` (`refresh_token_hash`);
|
||||
Reference in New Issue
Block a user