如何在构建过程中包含数据库更改(DDL 补丁、一次性数据插入等)?

发布于 2024-09-27 14:05:08 字数 177 浏览 0 评论 0原文

我运行构建脚本,然后必须记住每次部署应用程序时要运行哪个数据库 SQL 和 PL/SQL 脚本。如何将这些补丁包含在我的构建脚本中?还是每个人都手动运行它们?目前,我对补丁进行编号,以便知道运行它们的顺序,但有时我必须检查 SVN 历史记录才能知道从哪个编号开始。

我正在使用 PHP,但可以使用 Java 来解决这个问题。

I run my build script and then I have to remember which of the database SQL and PL/SQL scripts to run each time I deploy my application. How can I include these patches in my build script? Or does everybody just run them manually? Currently I number my patches so I know the order to run them, but sometimes I have to check SVN history to know what number to start at.

I'm using PHP but can use Java in my solution to this problem.

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

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

发布评论

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

评论(3

无声情话 2024-10-04 14:05:08

liquibase 可能会为您解决这个问题,它集成到 ant 或 maven 中,但也可以从 cmd 行启动

liquibase might solve this problem for you which integrates into ant or maven but can be started from cmd line too

乖乖公主 2024-10-04 14:05:08

您应该将更改保存为脚本,并将它们像其他代码一样放入源代码管理中。然后您就知道哪些更改属于哪些构建并且需要升级为产品。

You should be saving your changes as scripts and putting them in source control like the rest of your code. Then you know what changes belong to what build and need to be promoted to prod.

浮生未歇 2024-10-04 14:05:08

由于您使用的是 PHP phing/DbDeployTask将是一个明智的选择。对于每个数据库表,您将有一个启动文件和许多补丁,例如:

001 user.sql
002 project.sql
501 user-AddColumnAvatar.sql

等。

Since you're using PHP phing/DbDeployTask would be a smart choice. For every DB table you will have a start file and a number of patches, e.g.:

001 user.sql
002 project.sql
501 user-AddColumnAvatar.sql

etc.

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