创建“更新脚本”对于数据库项目?
当我发布软件版本和每个版本的分支版本时,如何轻松生成版本的更新/补丁脚本?我无法打开数据库项目并比较它们,因为它们的名称相同,而 Visual Studio 不喜欢这样。
我的下一个想法是将较低版本部署到数据库,然后通过打开下一个版本的软件来生成更改脚本。这似乎有点乏味。
另外,如何将其集成到设置项目而不是手动过程中?
As I release versions of software and branch versions for each release, how can I easily generate update/patch scripts for the versions? I can't open the database projects and compare them because they are named the same and visual studio doesn't like that.
The next idea I had was deploying lower version to a database and then generating a change script by opening up the next version of the software. This seems like it would be a bit tedious.
Also, how would one go about integrating this into a setup project instead of a manual process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使您使用新的实体框架,您仍然无法让 Visual Studio 等自动为您跟踪数据库架构中的更改,您必须手动跟踪版本之间的更改并应用它们(通常在升级的应用程序运行时)首次)。
我建议...
这是大多数应用程序的运行方式,例如 wordpress、blogengine.net;所有这些都以这种方式运行,在发布时,它们提供一个脚本来从头开始创建模式,另一个脚本用于从最后发布的版本更新它。
Even if you were using the new Entity Framework you still can't get Visual Studio etc to track changes in a database schema automatically for you, you'd have to track the changes between versions manually and apply them (usually when the upgraded app runs for the first time).
I would suggest...
This is how most apps run, wordpress, blogengine.net for example; all run in this mannor, when releasing they provide one script to create the schema from scratch, and another to update it from the last released version.