Skip to content

Instantly share code, notes, and snippets.

@derduskenga
Created July 29, 2020 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derduskenga/87d08cea03dba890d4131d9bd0b875a8 to your computer and use it in GitHub Desktop.
Save derduskenga/87d08cea03dba890d4131d9bd0b875a8 to your computer and use it in GitHub Desktop.
'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