import { runMigrations } from '../lib/postgres/migrations';
import { getPgPool } from '../lib/postgres/client';

async function main() {
  const result = await runMigrations();
  console.log('Migrations applied:', result.applied);
  console.log('Migrations skipped:', result.skipped);
}

main()
  .catch((error) => {
    console.error('Migration failed:', error);
    process.exitCode = 1;
  })
  .finally(async () => {
    await getPgPool().end();
  });
