NHibernate Maps freshly enabled modules before running Migrations?


On the current code from Codeplex source, there is an issue that I have run in to working thru the Pluralsight advanced videos.

I am adding a referenced object to my data model, but NHibernate can't do the mapping because the table isn't created yet.. However, the table isn't created yet because the migrations haven't been run..

The order of things should be :Run all migrations THEN run NHibernate mapping routines. otherwise, there is a nasty chicken and egg problem where I can't add new reference objects because they aren't tables yet.. Which can be a real doozy of a problem when I try to update my modules.

I have attached my module... (it requires taxonomy).. Enabling it will fail because with "association references unmapped class:MovieActorRecord" in the SessionConfigurationCache (line 76)

If I comment out all references to "MovieActorRecord" (its in the MoviePartRecord, ActorRecord, and MoviePart) then I can enable the module (the migration will run)... Once the Migration has run, I can then go back and uncomment out my changes.

However, I should be able to just "install" the module and shouldn't have to comment out code, to get my migrations to run..

Thanks in advance.

file attachments

Closed Apr 13, 2013 at 5:58 AM by BertrandLeRoy


jhandel wrote Apr 12, 2013 at 8:45 PM

You can close this issue.. I found the issue.. I spent several hours not noticing I was missing virtual tags on the model that was consistently breaking.. sorry :-(