用于处理累积更新的 RPM 技术?

发布于 2024-08-07 22:12:55 字数 515 浏览 4 评论 0原文

RPM 似乎非常擅长检查依赖关系和处理单个文件更新,但是处理跨多个版本的关系数据库的累积更新的最佳实践是什么?

例如,假设您的产品 Foo 版本为 1.2.1、1.2.2、1.2.3 和 1.3.0。其中每一个都存在需要 SQL 升级脚本的数据库架构更改。需要按顺序运行每个升级脚本才能升级到架构的当前版本。

假设客户已安装 1.2.2,并希望升级到 1.3.0。如何构建 RPM 包,以便拥有适当的可用脚本并针对数据库执行正确的升级脚本?在本例中,您需要执行 1.2.3 和 1.3.0 的升级脚本,而不是 1.2.1 或 1.2.2 的升级脚本。因为这些可能已经被执行了。

一种替代方法是要求按顺序升级到每个中间版本,强制本示例中的用户在 1.3.0 之前升级到 1.2.3。这似乎不太理想。另外,这可能需要通过外部进程“强制”,因为我在 RPM SPEC 文件中没有看到任何表明这一点的内容。

是否有任何已知的技术可以处理这个问题?谷歌搜索了一下没有暴露任何信息。

编辑:通过“已知”,我的意思是“经过尝试和证明”而不是理论上的。

RPM seems to be pretty good at checking dependencies and handling individual file updates, but what is the best practice for handling cumulative updates to, say, a relational database across multiple versions?

For instance, say you have product Foo with versions 1.2.1, 1.2.2, 1.2.3, and 1.3.0. In each of these, there were database schema changes that required SQL upgrade scripts. Running each upgrade script in sequence is required to get up to the current version of the schema.

Say a customer has 1.2.2 installed and wants to upgrade to 1.3.0. How can one structure the RPM package so that you have the appropriate scripts available and execute the correct upgrade scripts against the database? In this instance, you'd want to execute the upgrade scripts for 1.2.3 and 1.3.0, but not the ones for 1.2.1 or 1.2.2. since those have presumably already been executed.

One alternative is to require upgrading to each intermediate version in sequence, forcing the user in this example to upgrade to 1.2.3 before 1.3.0. This seems less than optimal. Also, this would presumably need to be "forced" through external process, since I don't see anything in the RPM SPEC file that would indicate this.

Are there any known techniques for handling this? A bit of Googling didn't expose any.

EDIT: By "known", I mean "tried and proven" not theoretical.

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

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

发布评论

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

评论(1

七堇年 2024-08-14 22:12:55

使用适合工作的正确工具。 RPM 可能不是正确的工具。像 Liquibase 这样的东西会更适合这项任务。

Use the right tool for the job. RPM probably isn't the right tool. Something like Liquibase would be better suited to this task.

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