I am thinking of using Entity Framework 6
Code First
to interact with the database along with DbUp
updating the database schema. The fact is that I do not want to use migration EF
for reasons. So, the workflow that I have achieved is:
- Change the model (add
POCO
s, change properties, etc.) - Run
Add-Migration temp_file
inVisual Studio Package Manager Console
- Run
Update-Database -Script
inVisual Studio Package Manager Console
- Take the generated scripts
sql
, including inserting a new row into the table__MigrationHistory
- Create a new
.sql
file and earned scripts - Delete
temp_file
- Run dbup
It works great on local and production servers, however, I don’t feel comfortable adding and removing temp_file
every time a new migration is created (I would like to have a constant stop temp_file
being added to the solution.).
So the question is:
Is there a better way to migrate a database using DbUp
with Entity Framework
?
source
share