Pull requests

#85 Merged
Repository
danielgoncalves danielgoncalves
Branch
default
Repository
andrewgodwin andrewgodwin
Branch
default

Record ran migration inside the same transaction block as the migration itself.

Author
  1. Daniel Gonçalves
Reviewers
Description

This is the logical thing to do, since both operations (the migration and history annotation) are closely related to each other. I was into a very confusing situation where the migration have ran successfully, but the record of migration history was canceled by unknown reason.

  • Learn about pull requests

Comments (2)

  1. Andrew Godwin repo owner

    Two things:

    1) This won't work in dry-run mode, you'll need to detect that and not record in that case (it was previously done by overriding done_migrate in the dry run subclass) 2) You can probably remove done_migrate, it'll be useless now.

  2. Daniel Gonçalves author

    Previously I kept done_migrate method to avoid to break someone else's code, since the method is a regular one. Now I've removed done_migrate, once I'm sure that there's no other calls to that method in the library's code.