const { sequelize } = require('../config/database');

async function checkTableStructure() {
  try {
    console.log('检查 livestock_policies 表结构...');
    
    const [rows] = await sequelize.query('DESCRIBE livestock_policies');
    
    console.log('livestock_policies表结构:');
    console.log('序号 | 字段名 | 类型 | 是否为空 | 默认值');
    console.log('-----|--------|------|----------|--------');
    
    rows.forEach((row, index) => {
      console.log(`${index + 1}. ${row.Field} | ${row.Type} | ${row.Null} | ${row.Default || 'NULL'}`);
    });
    
  } catch (error) {
    console.error('❌ 检查表结构失败:', error.message);
  } finally {
    await sequelize.close();
  }
}

checkTableStructure();