()
| 87121 | var saveCompletedMigration = (migrationName) => { |
| 87122 | const completedMigrations = getCompletedMigrations(); |
| 87123 | completedMigrations.push(migrationName); |
| 87124 | import_fs6.default.writeFileSync( |
| 87125 | migrationsFile, |
| 87126 | JSON.stringify(completedMigrations, null, 2) |
| 87127 | ); |
| 87128 | }; |
| 87129 | var runMigrations = async () => { |
| 87130 | if (!getIsGlobalConfigFileExist()) return; |
| 87131 | const config8 = getConfig(); |
| 87132 | if (config8.OCO_AI_PROVIDER === "test" /* TEST */) return; |
| 87133 | if ([ |
| 87134 | "deepseek" /* DEEPSEEK */, |
| 87135 | "groq" /* GROQ */, |
| 87136 | "mistral" /* MISTRAL */, |
| 87137 | "mlx" /* MLX */, |
| 87138 | "openrouter" /* OPENROUTER */, |
| 87139 | "llamacpp" /* LLAMACPP */, |
| 87140 | "aimlapi" /* AIMLAPI */ |
| 87141 | ].includes(config8.OCO_AI_PROVIDER)) { |
| 87142 | return; |
| 87143 | } |
| 87144 | const completedMigrations = getCompletedMigrations(); |
| 87145 | let isMigrated = false; |
| 87146 | for (const migration of migrations) { |
| 87147 | if (!completedMigrations.includes(migration.name)) { |
| 87148 | try { |
| 87149 | console.log("Applying migration", migration.name); |
| 87150 | migration.run(); |
| 87151 | console.log("Migration applied successfully", migration.name); |
| 87152 | saveCompletedMigration(migration.name); |
| 87153 | } catch (error) { |
| 87154 | ce( |
| 87155 | `${source_default.red("Failed to apply migration")} ${migration.name}: ${error}` |
| 87156 | ); |
| 87157 | process.exit(1); |
| 87158 | } |
| 87159 | isMigrated = true; |
| 87160 | } |
| 87161 | } |
| 87162 | if (isMigrated) { |
| 87163 | ce( |
| 87164 | `${source_default.green( |
| 87165 | "\u2714" |
| 87166 | )} Migrations to your config were applied successfully. Please rerun.` |
| 87167 | ); |
no test coverage detected
searching dependent graphs…