import { runMigrations } from '../../migrations/runner.js';
import { pool } from './connection.js';

const run = async () => {
  try {
    // Run migrations
    await runMigrations();
    
    console.log('Database initialized with migrations.');
    await pool.end();
  } catch (err) {
    console.error('Database init failed:', err.message);
    await pool.end();
    process.exit(1);
  }
};

run();
