/**
 * Migration: Add service_type column to hot_services table
 */

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // Check if column exists
    const tableInfo = await queryInterface.describeTable('hot_services');
    
    if (!tableInfo.service_type) {
      await queryInterface.addColumn('hot_services', 'service_type', {
        type: Sequelize.STRING(50),
        allowNull: false,
        defaultValue: 'travel',
        comment: '服务类型: travel(出行), accommodation(住宿), guide(导游), translation(翻译), consulting(咨询), other(其他)',
        after: 'name_pt'
      });
      console.log('✓ Added service_type column to hot_services table');
    } else {
      console.log('✓ service_type column already exists');
    }
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.removeColumn('hot_services', 'service_type');
    console.log('✓ Removed service_type column from hot_services table');
  }
};
