Quick Guide to Entity Framework Code First Part 3 - Automating Migrations

preview_player
Показать описание
Hello! In this video, we will enable our code to run migrations automatically.

Please leave a like if this video is helpful.

If you have a question in mind please leave a comment or if there are topics you would like to discuss.

If you want to follow along please get code from github repository below:

Timeline of this video for your convenience:

00:00 Intro
01:02 Code Repository
01:41 Delete Database
01:56 Add Migrate Database
05:44 Run completed application
06:32 Summary
Рекомендации по теме
Комментарии
Автор

Hey mate,

In a real-world, production app, you'd not want to do this. But might be ok for some development purposes.
Because:
1. The application needs DDL permissions, which is a terrible idea
2. It's not entirely safe with regards to how migrations are run
3. It's difficult to control

You'd want to generate idempotent migrations scripts from your migrations and have a separate service run that script during the CD/CI pipeline.
However, for anyone just starting out with EF Core, this may be completely acceptable during the learning process.

Keep it up!

nmillard