How to generate sql script from Entity Framework code first migrations

Just run the following command in the nuget package manager. This will generate the complete sql script for your migrations. This script would even work if some migrations have already been run on your database.

Update-Database -Script -SourceMigration:0

Published: January 21 2016

blog comments powered by Disqus