()
| 347 | }; |
| 348 | |
| 349 | const printMigrationStatus = async () => { |
| 350 | const client = await pool.connect(); |
| 351 | |
| 352 | try { |
| 353 | const current = await getCurrentSchemaVersion(client); |
| 354 | if (!current) { |
| 355 | logger.info(`ℹ️ No schema version recorded yet. Expected v${EXPECTED_SCHEMA_VERSION}.`); |
| 356 | return; |
| 357 | } |
| 358 | |
| 359 | logger.info(`📌 Current schema version: v${current.version}`); |
| 360 | logger.info(`🏷️ Label: ${current.label}`); |
| 361 | logger.info(`🕒 Applied at: ${current.applied_at}`); |
| 362 | logger.info(`🎯 Expected: v${EXPECTED_SCHEMA_VERSION} (${EXPECTED_SCHEMA_LABEL})`); |
| 363 | } catch (error) { |
| 364 | logger.error('❌ Migration status failed:', error); |
| 365 | process.exit(1); |
| 366 | } finally { |
| 367 | client.release(); |
| 368 | await pool.end(); |
| 369 | } |
| 370 | }; |
| 371 | |
| 372 | const command = process.argv[2] || 'apply'; |
| 373 |
no test coverage detected