import { pool } from '../config/database';

async function migrate() {
  try {
    console.log('Adding founder_quota column...');
    await pool.query(`
      ALTER TABLE residence_unit_types 
      ADD COLUMN founder_quota INT NOT NULL DEFAULT 0 AFTER founder_price;
    `);
    console.log('Success!');
    process.exit(0);
  } catch (error: any) {
    if (error.code === 'ER_DUP_FIELDNAME') {
      console.log('Column already exists.');
      process.exit(0);
    }
    console.error('Error:', error);
    process.exit(1);
  }
}

migrate();
