EF 4.3 Code-Based Migrations

命令关键字总结:

  • Install-Package EntityFramework
  • Enable-Migrations
  • Add-Migration
  • Update-Database
  • Update-Database –Verbose (相关的脚本会显示在Package Manager Console里,并最终应用到数据库)
  • Update-Database -Script -SourceMigration:$InitialDatabase -TargetMigration:"AddBlogUrl" (其中AddBlogUrl是Migration Name,这是生成sql文件but instead of actually applying the changes)

Update-Database -TargetMigration:"PerfectCreate" -Script

安装EF5.0

Install-Package EntityFramework –Pre

你可能感兴趣的:(migration)