The best way to control Claude Code, Codex and more from any computer or phone
| 1 | // The server logs these around pending migrations; the desktop reads them from its output tail, |
| 2 | // which keeps only the last few thousand characters, so each progress line also marks a running upgrade. |
| 3 | export const DATABASE_MIGRATIONS_STARTED_MESSAGE = "Running database migrations"; |
| 4 | export const DATABASE_MIGRATION_PROGRESS_MESSAGE = "Upgrading database"; |
| 5 | export const DATABASE_MIGRATIONS_FINISHED_MESSAGE = "Migrations ran successfully"; |
| 6 | |
| 7 | export function isRunningDatabaseMigrations(output: string): boolean { |
| 8 | return ( |
| 9 | Math.max( |
| 10 | output.lastIndexOf(DATABASE_MIGRATIONS_STARTED_MESSAGE), |
| 11 | output.lastIndexOf(DATABASE_MIGRATION_PROGRESS_MESSAGE), |
| 12 | ) > output.lastIndexOf(DATABASE_MIGRATIONS_FINISHED_MESSAGE) |
| 13 | ); |
| 14 | } |