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

Fix database always trying to update #5543

Merged
merged 2 commits into from
Oct 29, 2018
Merged

Fix database always trying to update #5543

merged 2 commits into from
Oct 29, 2018

Conversation

medariox
Copy link
Contributor

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

@ghost
Copy link

ghost commented Oct 29, 2018

DeepCode analyzed this pull request.
There are no new issues.

def checkDBVersion(self):
return self.connection.checkDBVersion()
def checkMajorDBVersion(self):
return self.connection.checkDBVersion()[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

self.connection.checkDBVersion() returns a tuple like: (41, 11)

(41, 11) >= 42 -> True

return self.connection.version

def execute(self):
utils.backup_database(self.connection.path, self.checkDBVersion())
utils.backup_database(self.connection.path, self.checkMajorDBVersion())
Copy link
Contributor

@sharkykh sharkykh Oct 29, 2018

Choose a reason for hiding this comment

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

I don't think these (the backup calls) should be changed.
Don't you need the tuple so that the database backup contains the minor version too?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's okay, because these backups are going to be of very old versions (< 42) and won't have a minor version anyway. The new versions are using self.connection.version which contains the major and minor version.

@medariox medariox merged commit 7582aa6 into develop Oct 29, 2018
@medariox medariox deleted the fix/db-always-update branch October 29, 2018 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants