I'm trying to seed my database with an npm script.
"scripts": {
"devstart": "set NODE_ENV=development && sequelize db:seed:all && nodemon ./server.js"
}
I keep getting an error saying that I have to explicitly define the dialect in my config. This is my config file:
{
"development": {
"use_env_variable": "LOCALDB",
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"use_env_variable": "JAWSDB_URL",
"dialect": "mysql"
}
}
Not entirely sure what I am doing wrong. :/
答案 0 :(得分:0)
您必须导出配置:
module.exports = {
"development": {
"use_env_variable": "LOCALDB",
"dialect": "mysql"
},
"test": {
"username": "root",
"password": null,
"database": "database_test",
"host": "127.0.0.1",
"dialect": "mysql"
},
"production": {
"use_env_variable": "JAWSDB_URL",
"dialect": "mysql"
}
}