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

查看:119
本文介绍了如何合并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,您可以找到一些提示 here

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