Skip to content

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#1100
disq wants to merge 1 commit intocloudquery:mainfrom
disq:fix/force-migrations

Conversation

@disq
Copy link
Member

@disq disq commented Jul 17, 2023

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 force flag is set it should always drop the previous data. This is an issue with the ElasticSearch plugin where change column doesn'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.Table from 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.

@disq disq requested a review from yevgenypats as a code owner July 17, 2023 16:50
@github-actions github-actions bot added the fix label Jul 17, 2023
@github-actions
Copy link

⏱️ Benchmark results

Comparing with 3340813

  • Glob-8 ns/op: 99.73 ⬇️ 0.97% decrease vs. 3340813

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (cbbecb8) 47.02% compared to head (137326a) 47.02%.

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           
Impacted Files Coverage Δ
plugin/testing_write_migrate.go 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@disq disq marked this pull request as draft July 17, 2023 18:55
@github-actions github-actions bot added fix and removed fix labels Jul 17, 2023
@disq disq marked this pull request as ready for review July 18, 2023 08:02
@github-actions github-actions bot added fix and removed fix labels Jul 18, 2023
@disq disq closed this Jul 18, 2023
@disq disq deleted the fix/force-migrations branch July 18, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants