简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM