Javascript 运行迁移时,对不推荐的错误消息进行续集
大家好,我是Sequelize和Node js的初学者, 我读了他们的官方文件,读了他们的github,搜索了他们的博客文章,却无法解决。 我不断收到警告信息:Javascript 运行迁移时,对不推荐的错误消息进行续集,javascript,node.js,express,sequelize.js,Javascript,Node.js,Express,Sequelize.js,大家好,我是Sequelize和Node js的初学者, 我读了他们的官方文件,读了他们的github,搜索了他们的博客文章,却无法解决。 我不断收到警告信息: GMT sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manua
GMT sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators at node_modules/sequelize/lib/sequelize.js:236:13
此错误仅在运行迁移时发生,但在Im正常启动服务器时不会发生
这是我的connection.js文件
所以我在谷歌上搜索了几天,下面是答案: 当连接到数据库时,运算符alliaes必须设置为false,如下所示:
sequelize = new Sequelize(config.database, config.username, config.password, Object.assign({}, config, {
pool: dbConst.pool,
operatorsAliases: false,
})
同样在migrations.config.json中,operatorAliases必须设置为false
在你的代码中总是使用Sequalize.Op,所以我在谷歌上搜索了几天,下面是答案: 当连接到数据库时,运算符alliaes必须设置为false,如下所示:
sequelize = new Sequelize(config.database, config.username, config.password, Object.assign({}, config, {
pool: dbConst.pool,
operatorsAliases: false,
})
同样在migrations.config.json中,operatorAliases必须设置为false
在代码中始终使用Sequalize.Op