调用“更新数据库”之前,如何查看EF代码首次迁移更改 [英] How to view the EF Code First Migrations changes before calling 'Update-Database'

查看:97
本文介绍了调用“更新数据库”之前,如何查看EF代码首次迁移更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Code First Migrations Beta 1。

I am using Code First Migrations Beta 1.

我希望看到在我实际调用Update-Database之前运行的Migrations和SQL软件包管理器控制台。

I would like to see the Migrations and SQL that will run before I actually call 'Update-Database' on the Package Manager Console.

有没有命令可以在Package Manager控制台上获取此信息?

Is there a command to get this information on the Package Manager Console?

推荐答案

查看下面的链接,搜索生成SQL脚本的部分。

Take a look at the link below and search for the section headed Generating an SQL Script.

ADO.Net团队博客

在Package Manager Console中运行 Update-Database -TargetDatabase:database-Script 命令

Run the Update-Database –TargetDatabase:"database" –Script command in Package Manager Console

这篇关于调用“更新数据库”之前,如何查看EF代码首次迁移更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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