如何合并 Drupal 数据库更改 [英] How to merge Drupal database changes

查看:29
本文介绍了如何合并 Drupal 数据库更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前使用 SVN 存储库来确保每个人的本地环境都是最新的.但是,Drupal 网站开发有些棘手,因为您编写的任何自定义代码(例如,为节点主体编写的 PHP 代码)都存储在数据库中,并且 SVN 工作副本无法识别更改.

We currently use an SVN repository to ensure everyone's local environments are kept up-to-date. However, Drupal website development is somewhat trickier in that any custom code you write (for instance, PHP code written for a node body) is stored in the DB and the changes aren't recognized by the SVN working copy.

目前有几个开发人员在 Drupal 站点的同一区域工作,但我们不确定如何最好地将我们本地的 Drupal 数据库更改合并在一起.提交数据库转储补丁充其量看起来很笨拙,而且很可能为此目的而效率低下且容易出错.

There are a couple of developers who are presently working on the same area of a Drupal site, but we're uncertain about how to best merge our local Drupal database changes together. Committing patches of database dumps seem clumsy at best and is most likely inefficient and error-prone for this purpose.

对于如何解决此问题的任何建议表示赞赏!

Any suggestions about how to approach this issue is appreciated!

推荐答案

不幸的是,数据库部署/更新是 Drupals 的弱点之一.请参阅这个问题&答案以及这个一些关于如何处理它的建议.

Unfortunately, database deployment/update is one of Drupals weak spots. See this question & answers as well as this one for some suggestions on how to deal with it.

至于 CCK,你可以找到一些提示 这里.

As for CCK, you could find some hints here.

至于内容中的 php 代码,我同意 googletorp 的观点,因为您应该避免这样做.但是,如果由于某种原因您绝对必须这样做,您可以尝试将代码简化为简单的函数调用.因此,您将在模块中拥有该功能本身(这将通过 SVN 进行跟踪).但是,无论如何,您离消除对内联代码的需求只有一小步......

As for php code in content, I agree with googletorp in that you should avoid doing this. However, if for some reason you absolutely have to do it, you could try to reduce the code to a simple function call. Thus you'd have the function itself in a module (and this would be tracked via SVN). But then you are only a little step from removing the need for the inline code anyways ...

这篇关于如何合并 Drupal 数据库更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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