feat(sync): allow to bypass drop statements when sync with alter enabled - #11708
Merged
sushantdhiman merged 1 commit intoDec 12, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11708 +/- ##
==========================================
- Coverage 95.83% 89.88% -5.96%
==========================================
Files 91 92 +1
Lines 8987 9095 +108
==========================================
- Hits 8613 8175 -438
- Misses 374 920 +546
Continue to review full report at Codecov.
|
Floppy012
force-pushed
the
feature/bypass-drop-on-alter-sync
branch
from
November 24, 2019 21:46
9eb8e3c to
cfe80df
Compare
sushantdhiman
approved these changes
Dec 12, 2019
Contributor
|
Thanks :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 testornpm run test-DIALECTpass 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
alteroption 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 thedropoption.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
alteroption 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: