我开发了使用sequelize的Nodejs应用程序。我一直在使用9.6,并且刚刚安装了10.6,并且还将数据库复制到了新版本(所以现在我有2个副本,每个服务器/版本一个。)
但是,我的应用仍然使用旧版本。我不确定该如何更改。是通过代码还是我应该以某种方式停止旧服务器的运行并启动新服务器?顺便说一下,我使用pgAdmin。
这是我的sequelize使用的config.json:
{
"development": {
"username": "postgres",
"password": "364200",
"database": "userbase",
"host": "127.0.0.1",
"port": 5433, // was 5432
"dialect": "postgres"
},
"test": {
"username": "postgres",
"password": "364200",
"database": "userbase",
"host": "127.0.0.1",
"port": 5433, // was 5432
"dialect": "postgres"
},
"production": {
"username": "postgres",
"password": "364200",
"database": "userbase",
"host": "127.0.0.1",
"port": 5433, // was 5432
"dialect": "postgres"
}
}
index.js(序列化)
sequelize = new Sequelize('userbase', 'postgres', '364200', {
host: '127.0.0.1',
port: '5433' // <--- ADD THIS HERE
dialect: 'postgres',
});
编辑:在评论中@Chiller的帮助下修复了该问题