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

posted @ 2012-05-10 14:16  chenjunbiao  阅读(231)  评论(0编辑  收藏  举报