将升级(与应用程序相关)应用于数据库

发布于 2024-07-29 05:28:07 字数 607 浏览 7 评论 0原文

因为我之前没有这样做过,所以我不确定我计划这样做的方式是否可以或者是否有更好的方法。 就像使用 Windows Installer 或 Install Shield 或 Windows Installer XML (WiX) 工具集一样。 任何帮助都会很棒,因为我不知道。

我们有一个产品,并且每隔几个月就会发布新版本。 到目前为止,我们只推出了完整版本,即版本 1.0 或版本 1.5,但没有从 1.0 升级到 1.2、1.3 到 .... 您明白了,对吧! 因此,任何获得版本 1.0 的客户都无法升级到版本 1.2 或 1.3 甚至最新版本。 他们必须卸载旧版本并安装最新版本。 这是不对的,但这是我们迄今为止可以做的。 但我们想改变它。

我的计划是为每个升级路径提供一个包含(Sql 脚本)的安装文件。 检查数据库中存储版本信息的表,并根据它运行不同的脚本来升级数据库。

我担心的是,一旦我们有超过 5 或 6 个不同的版本,这种方法可能无法扩展。

如果您可以指出有关此主题的任何文章或书籍,那也会有很大帮助。

另外,我们可以使用 Windows Installer 或 Install Shield 来实现此目的吗?

谢谢, _UB

Since I've not done this before I am not sure if the way I am planning to do this is okay or is there a better way. Like using Windows Installer or Install Shield or Windows Installer XML (WiX) toolset. Any help would be great, as I have no clue.

We have a product and we ship new version every few months. So far we've only been rolling out complete versions i.e. Either Version 1.0, or Version 1.5, but no upgrade from 1.0 to 1.2 to 1.3 to .... you get the picture, right! So any customer that get version 1.0 cannot upgrade to version 1.2 or 1.3 or even the latest. They'll have to uninstall old version and install the latest version. This is not right, but thats what we could do until now. But we'd like to change it.

My plan is to have a install file with (Sql Scripts) for each upgrade path. Check the table in database that stores the version info and depending on it run different script to upgrade database.

My concern is that this method may not be scalable, once we have more than 5 or 6 different versions.

If you could point to any articles or books on this topic, that would help a lot too.

Also, could we use Windows Installer or Install Shield for this?

thanks,
_UB

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

打小就很酷 2024-08-05 05:28:07

我们已经使用 DBGhost 一年左右的时间来将我们的数据库和我们的代码库置于源代码控制之下,它使这种事情变得非常容易。 它不仅经过深思熟虑,而且他们多年来一直使用它来推出自己的代码,所以它非常可靠。

We've been using DBGhost for a year or so now to keep our database under source control along with our codebase, and it makes this kind of thing dead easy. It's not just well thought through, but they've been using it to roll out their own code for years, so it's dead solid.

等待圉鍢 2024-08-05 05:28:07

你的问题很常见,我在上一份工作中也遇到过这种问题。 除了 RedGate 工具之外,还有另一个工具可以帮助您完成您需要做的事情。 这是一个名为 DB Ghost 的工具。 他们明确解决了版本控制问题,并且还有一个打包程序。 我建议试用 DB Ghost 产品,因为他们有一些关于多版本升级的有趣声明。 这是取自他们的常见问题解答 (http://www.innovartis.co.uk/faqs /faqs.aspx):

问:我们的问题是管理
期间数据结构发生变化
升级。 我们的产品线是
收缩包装,或可从
网站。 所以当用户下载时
升级,他们可以从
一个非常新的版本,很少
数据库结构发生变化,或者
升级可能是从非常旧的版本开始的
具有多种结构性
变化。 一次升级需要管理
这一切。 用户将不在现场,因此
我们无法握住他们的手。 我们有
希腊、澳大利亚、马来西亚的用户,
挪威等。如果在的话,DB Ghost 会怎样?
全部,处理远程更新
地点?

答:DB Ghost Packager Plus 产品是
专门解决这个问题的设计
问题,因为它可以动态处理
目标数据库所需的更新
无缝连接。

我只是提到这一点,因为我们公司正在尝试做类似的事情,而我正在对这个工具进行研究。

谢谢,
埃里克

Your problem is a pretty common one, and I've had to deal with this kind of problem at my last job. There is another tool aside from the RedGate tool that may help you do what you need to do. It's a tool called DB Ghost. They explicitly address the versioning problem, and have a packager as well. I would suggest doing a trial of the DB Ghost product because they have some interesting claims concerning multiple version upgrades. This was taken from their FAQ (http://www.innovartis.co.uk/faqs/faqs.aspx):

Q: Our problem is going to be managing
data structure changes during
upgrades. Our product line is
Shrink-Wrapped, or downloadable from
the website. So when a user downloads
an upgrade, they can be upgrading from
a very recent version, with few
database structure changes, or the
upgrade may be from a very old version
with a multitude of structural
changes. One upgrade needs to manage
it all. The user would be offsite, so
we can't hold their hand. We have
users in Greece, Australia, Malaysia,
Norway, etc. How would DB Ghost, if at
all, handle updates in remote
locations?

A: The DB Ghost Packager Plus product was
design to specifically address this
issue as it can dynamically handle the
required updates to a target database
seamlessly.

I'm just mentioning this because our company is trying to do something similar and I was doing research on this tool.

Thanks,
Eric

我很OK 2024-08-05 05:28:07

您是否坚持自己做,或者您是否会承诺并投资一个工具?

我真的很喜欢 Red-Gate 的 SQL Packager 的想法,它将“比较”您的两个数据库版本,然后创建一个 SQL 脚本、一个 C# 项目或一个独立的可执行文件以从版本 1 升级到版本 2。

您无法 100% 从 1.0、1.1 升级, 1.2、1.3 全部到 2.0 - 查看他们的网站,看看他们是否为该场景提供一些东西!

否则,我想事情会变得相当棘手和混乱……

Marc

Do you insist on doing it yourself, or could you see yourself committing and investing in a tool?

I really like the idea of Red-Gate's SQL Packager, which will "diff" your two database versions, and then create a SQL script, a C# project, or a stand-alone executable to upgrade from version 1 to version 2.

Not 100% how you'd be able to upgrade from 1.0, 1.1, 1.2, 1.3 all to 2.0 - check out their website and see if they offer something for that scenario!

Otherwise, I guess it'll get quite thorny and messy......

Marc

み格子的夏天 2024-08-05 05:28:07

在 Rails 世界中,他们使用一种称为迁移的工具/方法。

基本上可以归结为创建一个小的 SQL 脚本来升级和降级数据库的每个小更改。

当您测试应用程序时,您将数据库迁移到您想要的版本,并且在部署时应用程序可以检查它需要什么版本并迁移到该版本。

大多数流行语言都有免费的迁移工具包,但它们可能是某些 MVC 框架的一部分。

迁移的一个很好的副作用是您可以轻松地将数据库源代码存储在源代码控制存储库中。

In the Rails world they are using a tool/method called Migrations.

Basically is boils down to creating a small sql script to upgrade and downgrade each little change to the database.

When you are testing the application you migrate your database to the version you want and on deployment the application can check what version it needs and migrate to that version.

There are free migration toolkits for most popular languages, they might be part of some MVC framework though.

A nice side effect of migrations is that you have database source code that is easily stored in you source control repository.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文