从球队阵容城市运行更新数据库 [英] Running update-database from Team City

查看:183
本文介绍了从球队阵容城市运行更新数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用实体框架4.3数据库迁移的新应用程序。在迁移工作,使用更新数据库命令包管理器控制台很大。

I have created a new application using Entity Framework 4.3 database migrations. The migrations work great from the package manager console using the "update-database" command.

现在我想每一个应用程序使用Team市建时间运行数据库迁移,它看起来像我需要创建一个PowerShell脚本,将做到这一点。

Now I want to run the database migrations every time the application is built using Team City, it looks like I need to create a powershell script that will do this.

任何人都可以点我如何获得一些指令包管理器命令,在命令行或PowerShell中运行?所有我能找到的是如何通过包管理器控制台,我不知道如何从一个团队市构建步骤运行做的说明。

Can anyone point me to some instructions on how to get the package manager commands to run from the command line, or powershell? All I can find is instructions on how to do this via the package manager console, which I don't know how to run from a Team City build step.

推荐答案

migrate.exe就是我一直在寻找,它是在发现套餐\\ EntityFramework.4.3.1 \\工具。

migrate.exe is what I was looking for, it is found in "packages\EntityFramework.4.3.1\tools".

使用添加团队市新生成步骤:

Add a new build step in Team City using:

亚军类型:命令行

命令来执行:包\\ EntityFramework.4.3.1 \\工具\\ migrate.exe

Command executable: packages\EntityFramework.4.3.1\tools\migrate.exe

命令参数:MyApplicationName / StartupDirectory:MyApplicationName \\ BIN

Command parameters: MyApplicationName /StartupDirectory:MyApplicationName\bin

这篇关于从球队阵容城市运行更新数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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