'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up (queryInterface, Sequelize) {
    const articles = [];
    const counts = 10;
    
    for(let i = 1; i<= counts;i++){
      const article = {
        title:`文章的标题${i}`,
        content:`文章的内容${i}`,
        author:`文章的作者${i}`,
        category:`文章的分类${i}`,
        crop:`文章的作物${i}`,
        img:`文章的图片${i}`,
        createdAt:new Date(),
        updatedAt:new Date()
      }

      articles.push(article)
    }

    await queryInterface.bulkInsert('Articles',articles,{})
  },

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