create separate method for each currentVersion of class_sqlThread module#1715
Draft
navjotcis wants to merge 2 commits intoBitmessage:v0.6from
Draft
create separate method for each currentVersion of class_sqlThread module#1715navjotcis wants to merge 2 commits intoBitmessage:v0.6from
navjotcis wants to merge 2 commits intoBitmessage:v0.6from
Conversation
12aedb9 to
9ac0a28
Compare
PeterSurda
requested changes
Jan 19, 2021
Member
PeterSurda
left a comment
There was a problem hiding this comment.
As discussed on Skype, rework the decorator so that it handles the current version, and auto-populates the upgrade loop.
7fa12e4 to
ddd5b9d
Compare
PeterSurda
requested changes
Jan 21, 2021
|
|
||
| def db_upgrade(**kwargs): | ||
| """upgrade the migration""" | ||
| version_dict = kwargs |
| parameters = (4,) | ||
| self.cur.execute(item, parameters) | ||
|
|
||
| @db_upgrade(versio_four=4) |
| parameters = (5,) | ||
| self.cur.execute(item, parameters) | ||
|
|
||
| @db_upgrade(versio_five=5) |
src/class_sqlThread.py
Outdated
| '''INSERT INTO addressbook SELECT label, address FROM old_addressbook;''') | ||
| self.cur.execute('''DROP TABLE old_addressbook''') | ||
| self.cur.execute('''update settings set value=11 WHERE key='version';''') | ||
| if temp_dict.get(currentVersion) or currentVersion == 1: |
Member
There was a problem hiding this comment.
maybe add a dummy version 1?
f2b61dc to
f5b7734
Compare
Collaborator
|
Wouldn't it be better to tag 0.6.3.3 and declare it as last release supporting upgrade from 0.6.1 or older? I tried rewriting |
f5b7734 to
74188cf
Compare
Collaborator
|
This looks abandoned and superseded by #1760. |
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.
I have created a separate method for each version of the class_sqlThread module
and also added a decorator for removing repeated code.