const sequelize = require('./db');
const Activity = require('./Activity');
const Registration = require('./Registration');
const Expense = require('./Expense');
const Photo = require('./Photo');
const Sponsor = require('./Sponsor');
const Prize = require('./Prize');
const Admin = require('./Admin');
const VenueImage = require('./VenueImage');

// 同步数据库
// 使用 force: false 避免 SQLite alter 表时的约束冲突问题
sequelize.sync({ force: false }).then(() => {
  console.log('✓ 数据库同步完成');
}).catch(err => {
  console.error('✗ 数据库同步失败:', err.message);
});

module.exports = {
  sequelize,
  Activity,
  Registration,
  Expense,
  Photo,
  Sponsor,
  Prize,
  Admin,
  VenueImage
};
