1
A C# Winforms application, with the Entity Framework that accesses data in SQL Server in development phase we use Migrations to make the database according to our model, but then with the system already in production?
Usually on workstations and servers we do not have Visual Studio to run the "database update", before this, and also before my ignorance on the subject I ask how to run Migrations in the production environment?
We can use the code created by Migrations and add a functionality to the application, and this will maintain the database according to the model created for the application?
What I am doing is using the SQL script generated by Migrations to update the database, after a security backup to prevent data loss, but this would be the most appropriate procedure?
Thank you for the @Hudsonph information... This is exactly what I do in the development environment, but in the production environment there is a way to do it without the visual studio as I mentioned in the question?
– Ari Venuth
@Arivenuth Nao pq vc need the project to generate Migration in your case of code first, the best is what I recommend 'and not use Migration, and have your code free from Ef, in case you change for example to Dapper vc will not have problems.
– HudsonPH
I appreciate the tip to keep my EF code free, but at this stage of the project this is totally unfeasible. So the most indicated in my case, code first, is to create the initial migration generating the SQL script. If a change is needed, create the adaptation migration by generating the proper script and run it in the production SQL.
– Ari Venuth