Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
fix(migrations): resolve version collisions and add schema repair for quota thresholds
Markus Hartung8e5c1d9ead87
diff --git a/src/lib/db/core.ts b/src/lib/db/core.tsindex 59bb37dc92..d5bda22141 100644--- a/src/lib/db/core.ts+++ b/src/lib/db/core.ts@@ -520,6 +520,10 @@ function ensureProviderConnectionsColumns(db: SqliteDatabase) {db.exec("ALTER TABLE provider_connections ADD COLUMN max_concurrent INTEGER");console.log("[DB] Added provider_connections.max_concurrent column");}+ if (!columnNames.has("quota_window_thresholds_json")) {+ db.exec("ALTER TABLE provider_connections ADD COLUMN quota_window_thresholds_json TEXT");+ console.log("[DB] Added provider_connections.quota_window_thresholds_json column");+ }db.exec("CREATE INDEX IF NOT EXISTS idx_pc_max_concurrent ON provider_connections(provider, max_concurrent)");diff --git a/src/lib/db/migrationRunner.ts b/src/lib/db/migrationRunner.tsindex d53c66e9a9..578e9e5acf 100644--- a/src/lib/db/migrationRunner.ts+++ b/src/lib/db/migrationRunner.ts@@ -148,6 +148,9 @@ const LEGACY_VERSION_SLOT_MIGRATIONS = [{ version: "031", name: "api_keys_expires" },{ version: "032", name: "detailed_logs_warnings" },{ version: "033", name: "provider_connections_block_extra_usage" },+ { version: "033", name: "add_batch_id_to_call_logs" },+ { version: "046", name: "remove_status_from_files" },+ { version: "051", name: "remove_status_from_files" },] as const;const SUPERSEDED_DUPLICATE_MIGRATIONS = [diff --git a/src/lib/db/migrations/056_provider_connection_quota_window_thresholds.sql b/src/lib/db/migrations/057_provider_connection_quota_window_thresholds.sqlsimilarity index 100%rename from src/lib/db/migrations/056_provider_connection_quota_window_thresholds.sqlrename to src/lib/db/migrations/057_provider_connection_quota_window_thresholds.sql