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

async function migrate() {
  try {
    console.log('Adding plan_image_url column...');
    await pool.query('ALTER TABLE residence_unit_types ADD COLUMN plan_image_url VARCHAR(1000) NULL;');
    console.log('Column added successfully.');
  } catch (error: any) {
    if (error.code === 'ER_DUP_FIELDNAME') {
      console.log('Column already exists.');
    } else {
      console.error('Error adding column:', error);
    }
  } finally {
    process.exit(0);
  }
}

migrate();
