fix: Force migrate mode should expect 1 row#1100
Closed
disq wants to merge 1 commit intocloudquery:mainfrom
disq:fix/force-migrations
Closed
fix: Force migrate mode should expect 1 row#1100disq wants to merge 1 commit intocloudquery:mainfrom disq:fix/force-migrations
disq wants to merge 1 commit intocloudquery:mainfrom
disq:fix/force-migrations
Conversation
erezrokah
approved these changes
Jul 17, 2023
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #1100 +/- ##
=======================================
Coverage 47.02% 47.02%
=======================================
Files 85 85
Lines 7777 7777
=======================================
Hits 3657 3657
Misses 3785 3785
Partials 335 335
☔ View full report in Codecov by Sentry. |
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.
Force migrate should expect 1 row (the previous data to be dropped) not 2.
In plugin's migration handling code, there's no easy way to decide if we should drop the table or not. If
forceflag is set it should always drop the previous data. This is an issue with the ElasticSearch plugin wherechange columndoesn't work without force (but add/remove works).CAVEAT This breaks migration code where it detects if a change is necessary by comparing state of the current schema (by rebuilding a
schema.Tablefrom underlying data-storage) instead of always forcing a drop on force-migrate. Some destinations can't build the schema.Table back because of metadata loss (either can't read it back, or type mapping isn't 1-to-1) where this approach helps.