feat!: add model
parameter on model hooks run on sequelize
if they don't have an instance, add afterCount
#17020
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Description Of Change
Closes #16851
Model hooks also run on the Sequelize instance. Some of them include the model instance the hook runs on, but some of them don't have such an instance to include.
I added the model class to them instead.
This would be a breaking change because the model was added as the first parameter, to make them behave similarly to the
instance
parameter of other model hooks.This PR also adds the
afterCount
hook.First draft before I add all tests in case this change is a no-go in its current state
TODO
afterCount