从命令行迁移实体框架 [英] Entity Framework Migration From Command Line

查看:61
本文介绍了从命令行迁移实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从像Visual Studio cl这样的轻量级命令行执行一些实体框架迁移命令?

Is it possible doing some entity framework migration commands from a lightweight command line like visual studio cl?

我无法从本地访问远程sql express服务器visual studio,所以我不能添加迁移和更新数据库命令。因此,如果出现问题,我可以解决我的问题。

I can't access to my remote sql express server from local visual studio so I can't add-migration and update-database commands. So if there would be a cl, I could solve my problem.

推荐答案

EF提供了一个Migrate.exe工具可以通过命令行运行。

There is a Migrate.exe tool which comes with EF which you can run through the command line.

其文档可以在以下位置找到: http://msdn.microsoft.com/en-us/data/jj618307.aspx

Documentation for it can be found at: http://msdn.microsoft.com/en-us/data/jj618307.aspx

使用类似的东西:

Migrate.exe MyApp.exe /startupConfigurationFile="MyApp.exe.config" /targetMigration="myTargetMigration"

这篇关于从命令行迁移实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆