当我运行db:seed:all命令时,它给了我这个错误:
Seed file failed with error: Validation error
如何查看Sequelize中出现错误的验证日志?
答案 0 :(得分:3)
您可以使用命令的--debug
选项查看degub信息,例如:
$ sequelize db:seed:all --debug
此选项可通过输入以下内容找到:
$ sequelize db:seed:all --help
可以通过将sequelize config.js的logging属性设置为true来激活Sequelize的种子日志,如下所示:
{
"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"
}
}
可以在此处找到默认配置文件:Default configuration file for sequelize。
希望这会有所帮助:D