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

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // Check if column exists
    const tableInfo = await queryInterface.describeTable('hot_services');
    
    if (!tableInfo.detail_image) {
      await queryInterface.addColumn('hot_services', 'detail_image', {
        type: Sequelize.STRING(500),
        allowNull: true,
        comment: '详情图URL',
        after: 'image_url'
      });
      console.log('✓ Added detail_image column to hot_services table');
    } else {
      console.log('✓ detail_image column already exists');
    }
  },

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