const { Sequelize } = require('sequelize');

const sequelize = new Sequelize('insurance_db', 'root', '123456', {
  host: 'localhost',
  dialect: 'mysql',
  logging: false
});

async function checkClaimsTable() {
  try {
    const [results] = await sequelize.query('DESCRIBE livestock_claims');
    
    console.log('livestock_claims表结构:');
    console.log('='.repeat(50));
    
    results.forEach(field => {
      const required = field.Null === 'NO' ? '(必填)' : '(可选)';
      const defaultValue = field.Default ? ` 默认值: ${field.Default}` : '';
      console.log(`- ${field.Field}: ${field.Type} ${required}${defaultValue}`);
    });
    
  } catch (error) {
    console.error('检查表结构失败:', error.message);
  } finally {
    await sequelize.close();
  }
}

checkClaimsTable();