Running Entity Framework migrations at app startup, anyone doing this?

When using Entity Framework I’m more likely to be working in a DB first fashion so I don’t often have to consider this… BUT.. I agree with the OP on this thread from Reddit… running schema altering code at app startup without explicit interactions does sound scary

Many organisations won’t allow it on prod as elevated permissions would be required but even if it was permissible from a security perspective I’d rather let EF give me the suggested SQL rollout script for me to review it before pushing it into some CI pipeline.

What’s everyone doing? Is anyone applying migrations at runtime in production?

Also check out some interesting discussion on LinkedIn where I originally posted the above…

Leave a Reply

Your email address will not be published.