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

查看:190
本文介绍了如何合并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.

任何关于如何解决这个问题的建议, p>

Any suggestions about how to approach this issue is appreciated!

推荐答案

不幸的是,数据库部署/更新是Drupal的弱点之一。请参见此问题&答案以及这一个

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天全站免登陆