woensdag 23 oktober 2013

Entity framework 5; -Script for Migrate.exe


An Entity Framework 6 update is available here.

My current project supports an extensive continuous build system with distribution to a large number of end-users. To be able to track and control this process coordinators preferred SQL-scripts over the "new & wild" concept of migration classes enabling them to verify generated scripts and use their trusted proven infrastructure.
Unfortunately, unlike the package manager, the command line migration.exe doesn't support the -script option. Knowing it was possible from within Visual Studio I set off on a decompilation & exploration journey through power shell scripts and entity framework dll's.

Decompilation & Exploration overiewOnce everything was clear I built a console application directly talking to the scripting functionality in the EntityFramework.dll   You can download the source here. Do remember, all the code is provided as-is and without any warranty.


Special thanks to NDesk for the Options class, it works like a charm!

Geen opmerkingen: