/**
 * 栏舍数据种子文件
 * @file 20250118000003_pens_data.js
 * @description 插入栏舍测试数据
 */

'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    // 插入栏舍测试数据
    await queryInterface.bulkInsert('pens', [
      {
        name: '牛舍-001',
        animal_type: 'cattle',
        pen_type: '育肥牛舍',
        responsible: '张三',
        capacity: 50,
        status: true,
        description: '专门用于育肥牛的栏舍，配备完善的通风和饮水系统',
        farm_id: 1,
        creator: 'admin',
        created_at: new Date('2024-01-15 09:00:00'),
        updated_at: new Date('2024-01-15 09:00:00')
      },
      {
        name: '羊舍-001',
        animal_type: 'sheep',
        pen_type: '母羊舍',
        responsible: '李四',
        capacity: 100,
        status: true,
        description: '用于饲养母羊的栏舍，环境舒适，适合繁殖',
        farm_id: 1,
        creator: 'admin',
        created_at: new Date('2024-01-16 10:30:00'),
        updated_at: new Date('2024-01-16 10:30:00')
      },
      {
        name: '马舍-001',
        animal_type: 'horse',
        pen_type: '种马舍',
        responsible: '王五',
        capacity: 20,
        status: true,
        description: '专门用于种马饲养的高档栏舍',
        farm_id: 2,
        creator: 'admin',
        created_at: new Date('2024-01-17 14:20:00'),
        updated_at: new Date('2024-01-17 14:20:00')
      },
      {
        name: '家禽舍-001',
        animal_type: 'poultry',
        pen_type: '蛋鸡舍',
        responsible: '赵六',
        capacity: 500,
        status: true,
        description: '现代化蛋鸡饲养栏舍，配备自动喂料和集蛋系统',
        farm_id: 2,
        creator: 'admin',
        created_at: new Date('2024-01-18 08:45:00'),
        updated_at: new Date('2024-01-18 08:45:00')
      },
      {
        name: '猪舍-001',
        animal_type: 'pig',
        pen_type: '育肥猪舍',
        responsible: '孙七',
        capacity: 80,
        status: true,
        description: '现代化育肥猪栏舍，配备自动饮水系统',
        farm_id: 3,
        creator: 'admin',
        created_at: new Date('2024-01-19 11:15:00'),
        updated_at: new Date('2024-01-19 11:15:00')
      },
      {
        name: '牛舍-002',
        animal_type: 'cattle',
        pen_type: '奶牛舍',
        responsible: '周八',
        capacity: 60,
        status: true,
        description: '专门用于奶牛饲养的栏舍，配备挤奶设备',
        farm_id: 3,
        creator: 'admin',
        created_at: new Date('2024-01-20 13:30:00'),
        updated_at: new Date('2024-01-20 13:30:00')
      },
      {
        name: '羊舍-002',
        animal_type: 'sheep',
        pen_type: '羔羊舍',
        responsible: '吴九',
        capacity: 150,
        status: false,
        description: '用于饲养羔羊的栏舍，目前正在维护中',
        farm_id: 4,
        creator: 'admin',
        created_at: new Date('2024-01-21 16:00:00'),
        updated_at: new Date('2024-01-21 16:00:00')
      },
      {
        name: '家禽舍-002',
        animal_type: 'poultry',
        pen_type: '肉鸡舍',
        responsible: '郑十',
        capacity: 300,
        status: true,
        description: '用于肉鸡饲养的栏舍，配备温控系统',
        farm_id: 4,
        creator: 'admin',
        created_at: new Date('2024-01-22 09:30:00'),
        updated_at: new Date('2024-01-22 09:30:00')
      }
    ], {});
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.bulkDelete('pens', null, {});
  }
};
