Created
July 29, 2020 13:50
-
-
Save derduskenga/87d08cea03dba890d4131d9bd0b875a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fake = require('faker'); | |
module.exports = { | |
up: async (queryInterface, Sequelize) => { | |
let users = []; | |
for(let i=0; i<=100; i++){ | |
users.push({ | |
name: fake.name.firstName(), | |
email:fake.internet.email(), | |
createdAt:new Date(), | |
updatedAt:new Date(), | |
}); | |
} | |
await queryInterface.bulkInsert('Users',users, {}); | |
}, | |
down: async (queryInterface, Sequelize) => { | |
await queryInterface.bulkDelete('Users', null, {}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment