Closed expipiplus1 closed 7 years ago
What's a practical use case for this?
I'm asking, because the error semantics for executing a sequence of MigrationCommand
s are not obvious. E.g., what happens when you run the sequence [MigrationInitialization, MigrationFile, MigrationDirectory]
and the execution blows up during MigrationFile
? Is the initialisation rolled back? Do we need to execute the sequence in a database transaction? etc
postgresql-simple-migration seems to leave the transaction handling up to the user. I'd expect things to be rolled back if the user has wrapped things in a transaction.
I'd expect it to work as though all the commands were written out to files in a directory and MigrationDirectory
was called there. MigrationDirectory
is already a way of running a sequence of commands.
Alright, if you can come up with a solution I'll have a look and merge it in.
Thanks!
On Thu, Jan 26, 2017, 7:31 AM Andreas Meingast notifications@github.com wrote:
Closed #13 https://github.com/ameingast/postgresql-simple-migration/issues/13 via 6fe9957 https://github.com/ameingast/postgresql-simple-migration/commit/6fe995708d6c7ce5b050fc405cb3ab63ddef37cc .
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ameingast/postgresql-simple-migration/issues/13#event-937365206, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0U3Db1Kxkf-uiYDBx-OLDF4WLlN3c4ks5rWEvUgaJpZM4LqIki .
Would it make sense to add another constructor to
MigrationCommand
. This constructor would beMigrationCommands :: [MigrationCommand] -> MigrationCommand
. This would represent a sequence of commands to run one after another.