I want to use ELMAH with sql server on my ASP.net MVC 3 project, along with EF 4.3.
Is there a way I can have the sql script run automatically that creates the elmah tables?
I’m guessing that ef migrations might do the job but I haven’t used them much yet.
I’m aiming for a solution where you can checkout the solution and run it straight up (to sqlexpress locally or full blown sql server on deploy) and have it just work without having to manually run the various helper sql scripts
Add an empty code-based migration (just type
add-migration ElmahSetupwhen there are no pending DB changes).Then add calls to
Sql()to run the elmah in theUp()method. To make the solution complete you have to add corresponding drop statements to theDown()method.