mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(migrations): resolve version collisions and add schema repair for quota thresholds
This commit is contained in:
@@ -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)"
|
||||
);
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user