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 ElmahSetup
when there are no pending DB changes).
Then add calls to Sql()
to run the elmah in the Up()
method. To make the solution complete you have to add corresponding drop statements to the Down()
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With