1234567891011121314151617181920212223242526 |
- '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}`,
- createdAt:new Date(),
- updatedAt:new Date()
- }
- articles.push(article)
- }
- await queryInterface.bulkInsert('Articles',articles,{})
- },
- async down (queryInterface, Sequelize) {
- await queryInterface.bulkDelete('Articles', null, {});
- }
- };
|