Merge lp:~raoul-snyman/openlp/db-upgrades into lp:openlp
Status: | Superseded |
---|---|
Proposed branch: | lp:~raoul-snyman/openlp/db-upgrades |
Merge into: | lp:openlp |
Diff against target: |
397 lines (+181/-37) 6 files modified
openlp/core/lib/db.py (+81/-5) openlp/plugins/songs/lib/db.py (+15/-26) openlp/plugins/songs/lib/upgrade.py (+77/-0) openlp/plugins/songs/songsplugin.py (+3/-2) resources/debian/debian/control (+1/-1) scripts/check_dependencies.py (+4/-3) |
To merge this branch: | bzr merge lp:~raoul-snyman/openlp/db-upgrades |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andreas Preikschat (community) | Needs Fixing on 2011-08-25 | ||
Tim Bentley | 2011-08-25 | Approve on 2011-08-25 | |
Review via email:
|
This proposal supersedes a proposal from 2011-08-25.
This proposal has been superseded by a proposal from 2011-08-25.
Commit message
Implemented a seamless database upgrade system.
Description of the change
Database upgrade system.
1. Create a module to use for upgrading.
2. from migrate import changeset
3. Define some default tables, which use reflection, in an "upgrade_setup()" function.
4. Write your upgrade functions named "upgrade_X()" where X is the version number.
5. Write your upgrade statements using the extended methods from Migrate.
6. Make sure the DB manager object knows about the upgrade module.
Done!
Raoul Snyman (raoul-snyman) wrote : | # |
Andreas Preikschat (googol) wrote : | # |
You need to add the dependency to the scripts/
Please add docstrings to upgrade_1. It would be good if we document the "database history" and when we changed things.
- 1724. By Raoul Snyman on 2011-08-25
-
Fixed a bug where the version number saved to the database was incorrect. Added the ability to throw an error message and not load the database if the db is too new or incorrect.
- 1725. By Raoul Snyman on 2011-08-25
-
A few more tweaks as requested by Andreas.
To test this:
1. Install SQLAlchemy Migrate (eg: apt-get install python-migrate)
2. Backup your songs database
3. Run OpenLP
4. Look for a "weight" column on the "media_files" table