Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the seed log for Sequelize?

When I run db:seed:all command, it gives me this error:

Seed file failed with error: Validation error

How can I see the log of which validation that got error in Sequelize?

like image 900
Vicheanak Avatar asked Aug 12 '16 08:08

Vicheanak


1 Answers

You can see the degub info by using the --debug option to the command, like:

$ sequelize db:seed:all --debug

this option, and others can be found by typing:

$ sequelize db:seed:all --help

The seed log for Sequelize can be activated by setting true to the logging property of the sequelize config.js, as follow:

{
  "development": {
    "username": "root",
    "password": null,
    "logging": true,
    "database": "database_development",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "test": {
    "username": "root",
    "password": null,
    "logging": true,
    "database": "database_test",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "production": {
    "username": "root",
    "password": null,
    "logging": false,
    "database": "database_production",
    "host": "127.0.0.1",
    "dialect": "mysql"
  }
}

The default configuration file can be found here: Default configuration file for sequelize.

hope this helps :D

like image 93
Josiel Faleiros Avatar answered Sep 23 '22 13:09

Josiel Faleiros