import { sequelize } from '../src/config/database.js';
import './models/index.js';

async function syncDatabase() {
  try {
    await sequelize.authenticate();
    console.log('Connected to MySQL');
    
    await sequelize.sync({ alter: true });
    console.log('Database synchronized successfully');
    
    process.exit(0);
  } catch (error) {
    console.error('Sync failed:', error);
    process.exit(1);
  }
}

syncDatabase();