Merge lp:~jplacerda/zeitgeist/660307 into lp:zeitgeist/0.1
Proposed by
J.P. Lacerda
Status: | Merged |
---|---|
Merged at revision: | 1760 |
Proposed branch: | lp:~jplacerda/zeitgeist/660307 |
Merge into: | lp:zeitgeist/0.1 |
Diff against target: |
217 lines (+104/-27) 3 files modified
_zeitgeist/engine/__init__.py (+2/-0) _zeitgeist/engine/sql.py (+54/-25) test/sql-test.py (+48/-2) |
To merge this branch: | bzr merge lp:~jplacerda/zeitgeist/660307 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Siegfried Gevatter | Needs Fixing | ||
Markus Korn | Pending | ||
Review via email: mp+61268@code.launchpad.net |
To post a comment you must log in.
First of all, good work and thank you for working on this! :)
Some comments though:
1) version( cursor, schema_name, i+1)
> for i in xrange(old_version, new_version):
> _set_schema_
> _do_schema_backup()
The _do_schema_backup() call should be before the loop, otherwise the first upgrade isn't protected at all (also, in case of going through several version upgrades, you're needlesly backing up the database several times, the backup scripts don't create any new non-recoverable data, so just having the initial backup is enough).
2)
> # FIXME: This can return True, we just need a decent testing
> # framework first
> return True, cursor
As I said in bug #784011, this isn't true, since upgrade scripts rely on the code being run to do stuff such as updating the event view, creating new indices, etc. I also don't think we ought to change this, since copying the event view, indices, etc. into all upgrade scripts is a pain.
3)
Maybe I'm missing something but it looks like this will go into an endless loop if upgrading the schema fails (for some reason other than Zeitgeist being killed).