Skip to content

Instantly share code, notes, and snippets.

@Eth3rnit3
Created November 28, 2018 12:26
Show Gist options
  • Save Eth3rnit3/566ad599f71e2a89ee7c69c0b81b2156 to your computer and use it in GitHub Desktop.
Save Eth3rnit3/566ad599f71e2a89ee7c69c0b81b2156 to your computer and use it in GitHub Desktop.
const models = require('./models');
const User = models.User;
const Company = models.Company;
const WorkingDay = models.WorkingDay;
User.bulkCreate([
{email: 'john-doe@domain.com', firstName: 'John', lastName: 'DOE', companyId: 1},
{email: 'log_w@domain.com', firstName: 'Logan', lastName: 'WOLVERINE', companyId: 1},
{email: 'john-connor@domain.com', firstName: 'John', lastName: 'CONNOR', companyId: 1}
])
.then((newUsers) => {
console.log(newUsers)
})
.catch((err) => {
console.log("Error while users creation : ", err)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment