ameingast / postgresql-simple-migration

PostgreSQL Schema Migrations for Haskell
Other
85 stars 48 forks source link

Migrations should be executed within a transaction #1

Closed afiskon closed 10 years ago

afiskon commented 10 years ago

User can forget to use begin and commit in migration scripts. In case of error database will come to inconsistent state. To prevent this execute_ call should be covered by withTransaction.

ameingast commented 10 years ago

Fixed this in the standalone binary.

I don't want to add transactions inside the library code, though. The library user typically knows best when to close/open/roll-back his transactions. I've added more documentation and tried to make this more obvious.