Files
soroban-abacus-flashcards/apps/web/drizzle/0071_mcp_api_keys.sql
Thomas Hallock 31b9f9dac1 feat(docs): add auto-generated API documentation with Scalar UI
- Install next-openapi-gen for automatic OpenAPI spec generation from routes
- Add /api-docs page with Scalar UI for interactive API documentation
- Add generate step to build script (runs on every deploy)
- Configure to scan Zod schemas and App Router API routes
- Fix migration 0071 to use IF NOT EXISTS for idempotency
- Add public/openapi.json to .gitignore (generated file)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:56:27 -06:00

14 lines
597 B
SQL

-- MCP API Keys for external tool access (Claude Code, etc.)
CREATE TABLE IF NOT EXISTS `mcp_api_keys` (
`id` text PRIMARY KEY NOT NULL,
`user_id` text NOT NULL,
`key` text NOT NULL,
`name` text NOT NULL,
`last_used_at` integer,
`revoked_at` integer,
`created_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);--> statement-breakpoint
CREATE INDEX IF NOT EXISTS `mcp_api_keys_user_id_idx` ON `mcp_api_keys` (`user_id`);--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `mcp_api_keys_key_idx` ON `mcp_api_keys` (`key`);