I am thinking of using Entity Framework 6
Code First
for database interaction alongside DbUp
for database schema update. The thing is I don't want to use EF
migration for reasons. So, the workflow that I've reached to is:
- Change model (add
POCO
s, alter properties, etc) - Run
Add-Migration temp_file
inVisual Studio Package Manager Console
- Run
Update-Database -Script
inVisual Studio Package Manager Console
- Grab the generated
sql
scripts including insertion of new row in table__MigrationHistory
- Create a new
.sql
file and past the generated scripts - Delete
temp_file
- Run DbUp
It works perfectly locally and on production server, however I don't feel comfortable with adding and then deleting temp_file
every time a new migration is generated (I wish there were a way to permanently stop temp_file
being added to the solution.).
So question:
Is there a better way to do database migration with DbUp
using Entity Framework
?