Ok, I’ll try to answer anyway. I would say "No", there is no reason not to use the "First Code Migration" in production. After all, what's the point of this easy-to-use system if you cannot completely overcome it?
The biggest problems that I see are all the problems that can arise with any system that you have already talked about. As long as the entire team (DBA is enabled, if applicable) is on board, I think that allowing EF to manage the circuit using migrations is less complex and therefore less error prone than traditional script-based management. I would still take a backup before migrating to the production system, but then you do it anyway.
There is nothing that says the database administrator cannot migrate from Visual Studio. Access can still be locked with privileges at the database level, and he / she could view the migration (in the case of a useful SQL export format using -Script , if necessary) before performing the actual operation. Then they are still under control, but you can use the first code transformations. Damn, they can even love him!
Update: since SPROC and TVF were created, we also process them in migrations, although they are actually executed using SQL statements using the DbMigration.Sql() call in Up() , and vice versa in Down() (You can also use CreateStoredProcedure and DropStoredProcedure for simple SPROCs, but I think you still need to define the body in SQL). Perhaps you could say this reservation; there is as yet no opportunity for a complete, comprehensive database written exclusively in C #. However, you can use migrations that include SQL scripts to manage the entire schema. One of the advantages we found in this process is to use the C # configuration file for the names of the schema objects (for example, the names of different servers for production against dev) using a simple String.Format in combination with XML Transformation for the configuration files themselves.
DrewJordan Apr 20 '15 at 18:36 2015-04-20 18:36
source share