Skip to content

How to leverage models ? #2

@BeauBouchard

Description

@BeauBouchard

I am trying to leverage models from sequelize to do the migration

Conventionally I would do something like

'use strict';
module.exports = {
  up: function (queryInterface, Sequelize) {
 queryInterface.bulkInsert('users', [{
      firstName: 'John',
      lastName: 'Doe',
      eyeColor: 'green'
    }], {});
  },

  down: function (queryInterface, Sequelize)  {
    /*
      Add reverting commands here.
      Example:
      return queryInterface.bulkDelete('users', null, {});
    */
  }
};

I receive an error Unhandled rejection SequelizeDatabaseError: relation "users" does not exist

Is it because the models are not being utilized by the migrations.js?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions