Are migration UpgradeFromX() each done in their own transaction?

Topics: Core, General, Installing Orchard, Troubleshooting, Writing modules
Feb 8, 2012 at 5:37 PM

I was following the n-n relationships tutorial -- entered all the code into my module, and added two Update methods to the Migrations class: UpdateFrom2() (create schema), and UpdateFrom3() (insert static data).

When I tried to run update from the Dashboard it failed when trying to apply UpdateFrom3() because I forgot to take on the IRepsitory<RewardsProgramRecord> dependency in my migration class constructor. I fixed that and tried to upgrade via the dashboard again, but got an error in UpgradeFrom2() this time, saying the tables already exist. 

It looks like the app for some reason didn't persist the fact that UpdateFrom2() ran successfully the first time. Bug?

Feb 8, 2012 at 5:39 PM

Looks like it, yes. It looks as if the transaction was improperly rolled back somehow.

Feb 8, 2012 at 6:04 PM

Created issue: