[英]TFS VNext Build and Entity Framework Migrations - Visual Studio Team Services (was Visual Studio Online)
I'm building a .Net app using Entity Framework. 我正在使用实体框架构建.Net应用程序。
I have TFS vNext Builds setup and I'm doing auto publish to an azure web app. 我有TFS vNext Builds设置,并且正在自动发布到Azure Web应用程序。
I'd like to add a build task to automate my entity framework changes. 我想添加一个构建任务来自动执行我的实体框架更改。
I'm using code first and have migrations enabled, so I need a task that will run my migrations during the build to make any database schema changes, and seed test data that needs to be added/updated to the database. 我首先使用代码并启用了迁移,所以我需要一个任务,该任务将在构建期间运行我的迁移以进行任何数据库模式更改,并为需要添加/更新到数据库的测试数据提供种子。
Essentially I'd like to get the process used by ReadyRoll http://www.red-gate.com/products/sql-development/readyroll/ Without having to spend $350 per licence. 从本质上讲,我想获得ReadyRoll使用的过程http://www.red-gate.com/products/sql-development/readyroll/而不必花费每个许可证350美元。
You can install EntityFramework nuget package to your project. 您可以将EntityFramework nuget软件包安装到项目中。 And then restore the nuget package and call "migrate.exe" in the package folder to run the migration.
然后还原nuget程序包,并在程序包文件夹中调用“ migrate.exe”以运行迁移。 Refer to this question for details: How can I run Entity Framework's migrate.exe from Visual Studio Online?
有关详细信息,请参阅此问题: 如何从Visual Studio Online运行实体框架的migration.exe?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.