-
Notifications
You must be signed in to change notification settings - Fork 573
create separate method for each currentVersion of class_sqlThread module #1715
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
base: v0.6
Are you sure you want to change the base?
Conversation
12aedb9
to
9ac0a28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on Skype, rework the decorator so that it handles the current version, and auto-populates the upgrade loop.
7fa12e4
to
ddd5b9d
Compare
|
||
def db_upgrade(**kwargs): | ||
"""upgrade the migration""" | ||
version_dict = kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks weird
parameters = (4,) | ||
self.cur.execute(item, parameters) | ||
|
||
@db_upgrade(versio_four=4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
parameters = (5,) | ||
self.cur.execute(item, parameters) | ||
|
||
@db_upgrade(versio_five=5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a dummy version 1?
f2b61dc
to
f5b7734
Compare
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
This looks abandoned and superseded by #1760. |
I have created a separate method for each version of the class_sqlThread module
and also added a decorator for removing repeated code.