Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip automigrating for existing tables #705

Merged
merged 8 commits into from
Jun 4, 2022

Conversation

lpoli
Copy link
Contributor

@lpoli lpoli commented May 31, 2022

Fixes

This PR add version table so that we can later on migrate tables and its data based on this information.
Also, the automigration will drop tables only if automigration: true, default value is false.

@lpoli lpoli requested a review from cnlangzi May 31, 2022 11:07
@cnlangzi cnlangzi requested review from peterlimg and removed request for cnlangzi June 1, 2022 00:13
@cnlangzi
Copy link
Contributor

cnlangzi commented Jun 1, 2022

I don't how it works if a table is configured as keep_tables on yaml file, and there are new columns should be added, or some old columns should be dropped. let's waiting for @peterlimg to review

Drop all tables and automigrate schema only if automigration is set to true or database is newly created
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2022

Codecov Report

Merging #705 (1ad68de) into staging (2132c7d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           staging     #705   +/-   ##
========================================
  Coverage    24.06%   24.06%           
========================================
  Files           69       69           
  Lines         7957     7957           
========================================
  Hits          1915     1915           
  Misses        5757     5757           
  Partials       285      285           
Flag Coverage Δ
Unit-Tests 24.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2132c7d...1ad68de. Read the comment docs.

Copy link
Contributor

@cnlangzi cnlangzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have some misunderstand about AutoMigrate on schema. why a table has to be dropped before migrating its schema? nobody will drop table to loss all data when it is migrated. I can't understand your idea.

config/0chain_blobber.yaml Outdated Show resolved Hide resolved
code/go/0chain.net/blobber/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cnlangzi cnlangzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@service-0chain
Copy link
Collaborator

Manual system tests [success] with the following config

config value
tests skipped FALSE
system-tests master
gosdk NOT OVERRIDDEN
zboxcli staging
zwalletcli staging
0chain staging
blobber fix/automigrate-existing-table-issue
authorizer staging
0box staging
0block staging
0dns staging
explorer master
0proxy staging
0search staging

@lpoli lpoli merged commit 3f45eca into staging Jun 4, 2022
@lpoli lpoli deleted the fix/automigrate-existing-table-issue branch June 4, 2022 01:46
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.

4 participants