January 2019
Intermediate to advanced
460 pages
10h 33m
English
The challenge of adding users is that we have already introduced a foreign key constraint to the database. You can follow these instructions to learn how to get it working:
sequelize seed:generate --name fake-users --seeders-path src/server/seeders
'use strict';module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Users', [{ avatar: '/uploads/avatar1.png', username: 'TestUser', createdAt: new Date(), updatedAt: new Date(), }, { avatar: '/uploads/avatar2.png', username: 'TestUser2', createdAt: new Date(), updatedAt: new Date(), }], {}); }, down: (queryInterface, ...Read now
Unlock full access