Modify ↓
Ticket #212 (closed defect: fixed)
Make sure that any data changed in a dry-run gets rolled back
| Reported by: | juan@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.6 |
| Component: | migrations | Version: | 0.6-pre |
| Keywords: | Cc: | juan@…, simon@… |
Description
This ticket is related to #138.
In a forwards or backwards migration, MySQL first tests the migration with a dry run phase.
Although we could wrap data manipulation in if not db.dry_run: , this is error-prone because people will just forget to do it. Especially if we want migrations to be portable across databases, because testing on a SqlLite? database won't expose these errors on a MySQL one.
The attached patch causes the dry run phase to rollback any data manipulation before actually applying the migration.
Attachments
Change History
comment:1 Changed 4 years ago by andrew
- Status changed from new to closed
- Version set to Mercurial tip
- Resolution set to fixed
- Milestone set to 0.6
Indeed, I sometimes forget MySQL has transaction support, limited to data as it is. Applied in [a48162bf2f4b].
Note: See
TracTickets for help on using
tickets.
