Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egg-sequelize插件是否该升级了? #1762

Closed
tmcyfy opened this issue Nov 29, 2017 · 18 comments
Closed

egg-sequelize插件是否该升级了? #1762

tmcyfy opened this issue Nov 29, 2017 · 18 comments
Assignees

Comments

@tmcyfy
Copy link

tmcyfy commented Nov 29, 2017

egg 2.0

安装了 egg-sequelize 在用 npm run dev启动后提示

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 node_modules/sequelize/lib/sequelize.js:236:13

按照链接里的资料似乎是sequelize准备弃用原来的查询符,egg的sequelize是不是该更新了,还是我的版本问题?

@iyuq
Copy link
Contributor

iyuq commented Nov 29, 2017

这个应该是sequelize-cli的锅,现在sequelize-cli还只支持到sequelize 3.x,要等这个包修了这个warning才能去掉。
详情见:sequelize-support

@atian25
Copy link
Member

atian25 commented Jan 3, 2018

@iyuq 那边修复了没?

@iyuq
Copy link
Contributor

iyuq commented Jan 3, 2018

没有呀,可以看这个v4.0 #441,感觉是没人在做

@silent-tan
Copy link

mark

@duncup
Copy link

duncup commented Feb 24, 2018

sequelize-cli已更新

@atian25
Copy link
Member

atian25 commented Feb 24, 2018

@duncup egg 这边需要改动啥么

@duncup
Copy link

duncup commented Feb 24, 2018

@atian25
这个issues不是说sequelize-cli有锅么?
现在sequelize-cli升级到4.0了,已经支持到sequelize 4了。egg-sequelize是不是可以跟进一下然后关掉这个issues?

@atian25
Copy link
Member

atian25 commented Feb 24, 2018

@duncup PR 下?

@duncup
Copy link

duncup commented Feb 24, 2018

好,这个我等下看看。

@duncup
Copy link

duncup commented Feb 24, 2018

开了个会,耽误了下。 @atian25 刚刚确定了下,更新4.0之后报错依旧。似乎没有必要推上去了吧?

@iyuq
Copy link
Contributor

iyuq commented Feb 24, 2018

看了下报错,应该是 sequelize 的 constructor 中加了个 operatorsAliases 的配置参数,默认是 true,只要这个是 true,调用构造函数就会报这个 desperate 的信息。

@iyuq
Copy link
Contributor

iyuq commented Feb 24, 2018

要去掉这个错误可以在 config.default.js 中加

config.sequelize = {
    operatorsAliases: false,
  };

@atian25
Copy link
Member

atian25 commented Feb 24, 2018

为啥在 local 加

@iyuq
Copy link
Contributor

iyuq commented Feb 24, 2018

在 config 里加,那几个 config 都要加。

@atian25
Copy link
Member

atian25 commented Feb 24, 2018

直接加到 default 就好了吧,会合并的

@iyuq
Copy link
Contributor

iyuq commented Feb 24, 2018

@atian25 我修改了,看看是这样不

@atian25
Copy link
Member

atian25 commented Feb 24, 2018

嗯。如果是必须的,那是不是直接在 egg-sequelize 里面配置默认值?

@iyuq
Copy link
Contributor

iyuq commented Feb 25, 2018

@atian25 这样会影响以前使用了$or这类 Op的,为了兼容只能默认开启,不想看到这个warning的自己去配置关掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants