I'm submitting a ...
[ ] bug report
[x] feature request
Now that Sequelize v6 is out, we should add support
Hey @thebigredgeek thanks for bringing this up. Can you provide docs (breaking changes) for version 6? I couldn't find any.
@RobinBuschmann I only found these release notes with breaking changes note https://github.com/sequelize/sequelize/releases/tag/v6.0.0%40next
Any updates on this?
As far as I can see it, just hooks won't work anymore if upgrading to sequelize v6. Anything else should still be untouched. But anyway, the only thing that needs to be changed (or better added) is support for the new syntax model.hooks.add:
function installHook(model: typeof Model, hook: HookMeta): void {
+ const addHook = 'addHook' in model
+ ? (...args: any[]) => model.addHook(...args)
+ : (...args: any[]) => model.hooks.add(...args);
if (hook.options && hook.options.name) {
+ addHook(hook.hookType, hook.options.name, model[hook.methodName]);
- model.addHook(hook.hookType, hook.options.name, model[hook.methodName]);
return;
}
+ addHook(hook.hookType, model[hook.methodName]);
- model.addHook(hook.hookType, model[hook.methodName]);
}
Do I've overseen something? Anything else that needs to be adjusted in order to support v6? PR's are welcome ;)
[email protected] has been released and it supports sequelize >= 2.0.0! 馃帀
Most helpful comment
@RobinBuschmann I only found these release notes with breaking changes note https://github.com/sequelize/sequelize/releases/tag/v6.0.0%40next