Generate full SQL script from EF 5 Code First Migrations

前端 未结 3 1393
囚心锁ツ
囚心锁ツ 2020-12-02 04:11

How do I use Entity Framework 5 Code First Migrations to create a full database script from the initial (empty) state to the latest migration?

The blog post at MSDN

3条回答
  •  忘掉有多难
    2020-12-02 04:32

    The API appears to have changed (or at least, it doesn't work for me).

    Running the following in the Package Manager Console works as expected:

    Update-Database -Script -SourceMigration:0
    

提交回复
热议问题