feat(sync): allow to bypass drop statements when sync with alter enabled #11708
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 check-list
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
This is a less impactful version of a PR from last year (#9732 #9731). This feature implements the ability for the
alter
option to take an object for further configuration of the alter process duringsequelize.sync()
. Inside of the object the developer then can decide whether to allow drop statements or not using thedrop
option.To give a small example why this feature is useful: I'm currently developing an app that can be extended by plugins. These plugins should have the ability to extend existing database models. I found out about the
alter
option in sync but it is currently not suitable for me since the end-user would instantly lose data if a plugin would not load correctly or would get removed by the user.Usage of this feature would look like this: