Modify

Ticket #212 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

rollback-dry-run.patch (2.3 KB) - added by juan@… 5 years ago.

Change History

Changed 5 years ago by juan@…

comment:1 Changed 5 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].

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.