Fix DB schemas (#138)

This commit is contained in:
Will Chen
2025-05-12 21:51:08 -07:00
committed by GitHub
parent f5a6a1abca
commit 993c5417e3
10 changed files with 273 additions and 128 deletions

View File

@@ -11,11 +11,12 @@ CREATE TABLE `language_models` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`display_name` text NOT NULL,
`api_name` text NOT NULL,
`provider_id` text NOT NULL,
`builtin_provider_id` text,
`custom_provider_id` text,
`description` text,
`max_output_tokens` integer,
`context_window` integer,
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
FOREIGN KEY (`provider_id`) REFERENCES `language_model_providers`(`id`) ON UPDATE no action ON DELETE cascade
FOREIGN KEY (`custom_provider_id`) REFERENCES `language_model_providers`(`id`) ON UPDATE no action ON DELETE cascade
);

View File

@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
"id": "424973e5-a102-4b71-8d5d-6160f1609b8c",
"id": "0a47ec41-9477-4457-b3e8-e5ecb3e3a855",
"prevId": "ceedb797-6aa3-4a50-b42f-bc85ee08b3df",
"tables": {
"apps": {
@@ -210,11 +210,18 @@
"notNull": true,
"autoincrement": false
},
"provider_id": {
"name": "provider_id",
"builtin_provider_id": {
"name": "builtin_provider_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"notNull": false,
"autoincrement": false
},
"custom_provider_id": {
"name": "custom_provider_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"description": {
@@ -257,12 +264,12 @@
},
"indexes": {},
"foreignKeys": {
"language_models_provider_id_language_model_providers_id_fk": {
"name": "language_models_provider_id_language_model_providers_id_fk",
"language_models_custom_provider_id_language_model_providers_id_fk": {
"name": "language_models_custom_provider_id_language_model_providers_id_fk",
"tableFrom": "language_models",
"tableTo": "language_model_providers",
"columnsFrom": [
"provider_id"
"custom_provider_id"
],
"columnsTo": [
"id"

View File

@@ -40,8 +40,8 @@
{
"idx": 5,
"version": "6",
"when": 1747091036229,
"tag": "0005_superb_lady_mastermind",
"when": 1747095436506,
"tag": "0005_clumsy_namor",
"breakpoints": true
}
]