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:
- We use the Sequelize CLI to generate an empty seeders file, as follows:
sequelize seed:generate --name fake-users --seeders-path src/server/seeders
- Fill in the following code to insert the fake users:
'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, ...