Code First Initialization

Oct 9, 2011 at 2:56 PM

What is the best way to handle db specific stuff (primarily indexes) during database initialization?  I think in general that code first works well from a code perspective (imagine that), but I'm not really crazy any of the db stuff - mapping many to many tables, creating identity columns and I'm wondering how scripts for indexes will work.

Oct 10, 2011 at 2:34 PM
In the overridden seed method of the Initializer.

.Database.ExecuteSqlCommand("CREATE INDEX IX_NAME ON ...");