Merge lp:~kamstrup/zeitgeist/schema_versions into lp:zeitgeist/0.1
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merge reported by: | Mikkel Kamstrup Erlandsen | ||||||||
Merged at revision: | not available | ||||||||
Proposed branch: | lp:~kamstrup/zeitgeist/schema_versions | ||||||||
Merge into: | lp:zeitgeist/0.1 | ||||||||
Diff against target: |
280 lines (+231/-1) 3 files modified
_zeitgeist/engine/__init__.py (+4/-0) _zeitgeist/engine/sql.py (+84/-1) _zeitgeist/engine/upgrades/core_0_1.py (+143/-0) |
||||||||
To merge this branch: | bzr merge lp:~kamstrup/zeitgeist/schema_versions | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Siegfried Gevatter | diff review | Approve | |
Review via email: mp+26231@code.launchpad.net |
Description of the change
It's not very thoroughly tested yet, but upgrades <= 0.3.3 to 0.3.4 seem to work.
But what is this?
Versioning of the core DB schema (and also adds the possibility to version other schema if we ever have that).
On startup we check if the schema version for the 'core' schema is what we expect and if that is case we assume the schema is good and no further setup is needed.
If the schema version is not what we want we look for a module called _zeitgeist.
In our case we are talking upgrading from core schema 0 to 1, so that would be _zeitgeist.
Note that I did it this way in order to minimize the number of .py files we need to stat and/or parse at startup. If no upgrades are necessary, none of the upgrade .py files are parsed let alone read from disk.
Go, go, go!