'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 插入转栏记录数据
    await queryInterface.bulkInsert('cattle_transfer_records', [
      {
        record_id: 'TR202501001',
        animal_id: 1,
        from_pen_id: 1,
        to_pen_id: 2,
        transfer_date: new Date('2025-01-15'),
        reason: '正常调栏',
        operator: '张三',
        status: '已完成',
        remark: '根据饲养计划进行正常调栏',
        farm_id: 1,
        created_at: new Date('2025-01-15 10:30:00'),
        updated_at: new Date('2025-01-15 10:30:00')
      },
      {
        record_id: 'TR202501002',
        animal_id: 2,
        from_pen_id: 1,
        to_pen_id: 3,
        transfer_date: new Date('2025-01-16'),
        reason: '疾病治疗',
        operator: '李四',
        status: '进行中',
        remark: '因健康问题转入治疗栏',
        farm_id: 1,
        created_at: new Date('2025-01-16 14:20:00'),
        updated_at: new Date('2025-01-16 14:20:00')
      },
      {
        record_id: 'TR202501003',
        animal_id: 3,
        from_pen_id: 2,
        to_pen_id: 1,
        transfer_date: new Date('2025-01-17'),
        reason: '配种需要',
        operator: '王五',
        status: '已完成',
        remark: '为配种需要调整栏舍',
        farm_id: 1,
        created_at: new Date('2025-01-17 09:15:00'),
        updated_at: new Date('2025-01-17 09:15:00')
      },
      {
        record_id: 'TR202501004',
        animal_id: 4,
        from_pen_id: 1,
        to_pen_id: 4,
        transfer_date: new Date('2025-01-18'),
        reason: '隔离观察',
        operator: '赵六',
        status: '已完成',
        remark: '新引进牛只隔离观察',
        farm_id: 1,
        created_at: new Date('2025-01-18 11:00:00'),
        updated_at: new Date('2025-01-18 11:00:00')
      },
      {
        record_id: 'TR202501005',
        animal_id: 5,
        from_pen_id: 2,
        to_pen_id: 5,
        transfer_date: new Date('2025-01-19'),
        reason: '疾病治疗',
        operator: '孙七',
        status: '进行中',
        remark: '病牛转入治疗栏',
        farm_id: 1,
        created_at: new Date('2025-01-19 15:30:00'),
        updated_at: new Date('2025-01-19 15:30:00')
      }
    ], {});
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('cattle_transfer_records', null, {});
  }
};
