Opened 14 years ago
Closed 14 years ago
#629 closed defect (fixed)
Remove references to bitten.model from bitten.upgrades
Reported by: | hodgestar | Owned by: | hodgestar |
---|---|---|---|
Priority: | minor | Milestone: | 0.6 |
Component: | General | Version: | 0.6b2 |
Keywords: | Cc: | ||
Operating System: |
Description (last modified by hodgestar)
It is not safe for bitten upgrade functions to access bitten.model since the model may be updated at a later stage retroactively breaking upgrade scripts.
As an example, schema version 9 added a 'filename' field to BuildLog. Any attempts to do BuildLog.fetch(...) on earlier versions of the schema thus fail.
Recently we were caught out by the new 'last_activity' field in ticket #596.
Attachments (1)
Change History (8)
comment:1 Changed 14 years ago by hodgestar
- Operating System BSD deleted
comment:2 Changed 14 years ago by hodgestar
- Description modified (diff)
Changed 14 years ago by hodgestar
comment:3 Changed 14 years ago by hodgestar
- Owner set to hodgestar
The patch above covers all cases except the deletion of builds issue described in #596. Ideally I'd like to commit the patch before 0.6b3 since the only way we're likely to detect issues raised by it is by having people test it for us. Even more ideally I'd like feedback before committing.
I have run the upgrade test suite against SQLite, MySQL 5.1.41 and PostgreSQL 8.4.5 and not encountered any issues.
Creating the patch was a worthwhile exercise in and of itself. Post the official 0.6 release I plan to start deprecating the older upgrade functions (in particular those that import the dbxml module which I have so far failed to locate).
comment:4 Changed 14 years ago by hodgestar
- Status changed from new to assigned
comment:5 Changed 14 years ago by osimons
If you're OK with this patch, then so am I. It looks to be very well researched and thoughtful.
Put it to real-world testing now in time for beta 3. If nothing else, I'm quite sure it does more good than harm :-)
comment:6 Changed 14 years ago by hodgestar
comment:7 Changed 14 years ago by hodgestar
- Resolution set to fixed
- Status changed from assigned to closed
Closing instead. Comments still welcome.
Remove bitten.model dependencies from bitten.upgrades.