CREATE TABLE `providers` (
	`api_key` text NOT NULL,
	`base_url` text NOT NULL,
	`created_at` text NOT NULL,
	`enabled` integer DEFAULT 1 NOT NULL,
	`id` text PRIMARY KEY NOT NULL,
	`name` text NOT NULL,
	`type` text DEFAULT 'openai-compatible' NOT NULL,
	`updated_at` text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `providers_name_unique` ON `providers` (`name`);
--> statement-breakpoint
CREATE TABLE `models` (
	`capabilities` text NOT NULL,
	`context_length` integer,
	`created_at` text NOT NULL,
	`enabled` integer DEFAULT 1 NOT NULL,
	`id` text PRIMARY KEY NOT NULL,
	`max_output_tokens` integer,
	`model_id` text NOT NULL,
	`name` text NOT NULL,
	`provider_id` text NOT NULL,
	`updated_at` text NOT NULL,
	FOREIGN KEY (`provider_id`) REFERENCES `providers`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE UNIQUE INDEX `models_provider_id_model_id_unique` ON `models` (`provider_id`,`model_id`);
--> statement-breakpoint
CREATE INDEX `models_provider_id_idx` ON `models` (`provider_id`);
