【发布时间】:2011-07-22 16:06:56
【问题描述】:
我在 Drupal 6 中有这个查询
SELECT term_data.tid AS tid,
term_data.name AS term_data_name,
term_data.vid AS term_data_vid,
term_data.weight AS term_data_weight
FROM term_data term_data
LEFT JOIN term_node term_node ON term_data.tid = term_node.tid
INNER JOIN node node_term_node ON term_node.vid = node_term_node.vid
如何将那个迁移到 Drupal 7 架构?我有这样的东西,但它不起作用
SELECT
taxonomy_term_data.tid,
taxonomy_term_data.vid,
taxonomy_term_data.name
FROM
taxonomy_term_data
LEFT JOIN taxonomy_index ON taxonomy_term_data.tid = taxonomy_index.tid
Inner Join node ON taxonomy_index.vid = node.vid
问题是 taxonomy_index.vid 不存在。
我还没有找到 drupal 7 数据库模式文档,知道吗?请 谢谢
【问题讨论】:
-
您不能查看数据库并检查有关如何构造查询的表吗?
-
您要查找的列可能在
taxonomy_vocabulary.vid。你到底想完成什么? -
我想完成上面显示的 Drupal 6 查询中正在完成的工作:它是一个分类列表。