I am thinking of using Entity Framework 6 Code Firstto interact with the database along with DbUpupdating the database schema. The fact is that I do not want to use migration EFfor reasons. So, the workflow that I have achieved is:
- Change the model (add
POCOs, change properties, etc.) - Run
Add-Migration temp_fileinVisual Studio Package Manager Console - Run
Update-Database -ScriptinVisual Studio Package Manager Console - Take the generated scripts
sql, including inserting a new row into the table__MigrationHistory - Create a new
.sqlfile 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_fileevery time a new migration is created (I would like to have a constant stop temp_filebeing added to the solution.).
So the question is:
Is there a better way to migrate a database using DbUpwith Entity Framework?
source
share