'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 插入栏舍设置数据
    await queryInterface.bulkInsert('cattle_pens', [
      {
        name: '杭嘉新村栏舍01',
        code: 'PEN001',
        type: '育成栏',
        capacity: 50,
        current_count: 15,
        area: 200.50,
        location: '养殖场东区1号位置',
        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')
      },
      {
        name: '杭嘉新村栏舍02',
        code: 'PEN002',
        type: '产房',
        capacity: 20,
        current_count: 8,
        area: 150.00,
        location: '养殖场西区2号位置',
        status: '启用',
        remark: '专门用于母牛产房',
        farm_id: 1,
        created_at: new Date('2025-01-15 10:35:00'),
        updated_at: new Date('2025-01-15 10:35:00')
      },
      {
        name: '杭嘉新村栏舍03',
        code: 'PEN003',
        type: '配种栏',
        capacity: 10,
        current_count: 3,
        area: 80.00,
        location: '养殖场南区3号位置',
        status: '启用',
        remark: '用于公牛配种',
        farm_id: 1,
        created_at: new Date('2025-01-15 10:40:00'),
        updated_at: new Date('2025-01-15 10:40:00')
      },
      {
        name: '杭嘉新村栏舍04',
        code: 'PEN004',
        type: '隔离栏',
        capacity: 15,
        current_count: 2,
        area: 120.00,
        location: '养殖场北区4号位置',
        status: '启用',
        remark: '用于隔离观察病牛',
        farm_id: 1,
        created_at: new Date('2025-01-15 10:45:00'),
        updated_at: new Date('2025-01-15 10:45:00')
      },
      {
        name: '杭嘉新村栏舍05',
        code: 'PEN005',
        type: '治疗栏',
        capacity: 8,
        current_count: 1,
        area: 60.00,
        location: '养殖场中心区5号位置',
        status: '启用',
        remark: '用于病牛治疗',
        farm_id: 1,
        created_at: new Date('2025-01-15 10:50:00'),
        updated_at: new Date('2025-01-15 10:50:00')
      }
    ], {});
  },

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