2

In my SailsJS app, when I enter the command into the terminal:

sequelize db:seed:all

I get the response:

Unknown arguments: models, username, password, database, host, dialect

Also when I run:

sequelize -v

I get back:

Sequelize CLI [Node: 6.2.1, CLI: 3.2.0, ORM: 4.28.6]

WARNING: This version of Sequelize CLI is not fully compatible with 
Sequelize v4. https://github.com/sequelize/cli#sequelize-support

I am connected to the db and I am able to run my app as well as update the db from the client. The problems seems to be totally restricted to Sequelize/Sequelize-CLI.

user3143105
  • 129
  • 1
  • 12

3 Answers3

1

This is because sequelize did not get a configuration file. You need to create a separate configuration file for this. Example file:

module.exports = {
    database: 'dbname',
    host: 'hostenv',
    password: 'password',
    port: '5432',
    username: 'dbuser',
    dialect: 'postgres',
    pool: {
            max:5,
            min:0,
            idle:10000
         }
}

Now you can run: sequelize --config=sequelize-config.js db:seed:all

himank
  • 439
  • 3
  • 5
0

I suggest you to see your seed file, You can use sequelize-cli@3 (There is no sequelize-cli@4.x or pre production version yet), it will work with sequelize@4. Only incompatibility will be this sequelize/cli#470.

Scripty Mind
  • 13
  • 1
  • 4
0

This happens because your sequelize library can not find the config file. so to solve the problem you can point your sequelize to the config file in the project the connect to your local database by using this commad and parameters

sequelize --config=directory-for-/config.js db:seed:all

then wala you can run the successfully