From db5368027e7b38a274e17bf002f543a0ffbbd7ae Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 22 Aug 2010 13:55:53 +0000 Subject: - Patch #880132 by bojanz: hook_schema() doesn't support compound foreign keys; inconsistent implementations in core. --- modules/forum/forum.install | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'modules/forum') diff --git a/modules/forum/forum.install b/modules/forum/forum.install index 205430dd1..9a1ae18f6 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -153,8 +153,13 @@ function forum_schema() { ), 'primary key' => array('vid'), 'foreign keys' => array( - 'nid' => array('node' => 'nid'), - 'vid' => array('node' => 'vid'), + 'forum_node' => array( + 'table' => 'node', + 'columns' => array( + 'nid' => 'nid', + 'vid' => 'vid', + ), + ), ), ); @@ -214,8 +219,16 @@ function forum_schema() { 'forum_topics' => array('tid', 'sticky', 'last_comment_timestamp'), ), 'foreign keys' => array( - 'node' => 'nid', - 'taxonomy_term_data' => 'tid', + 'tracked_node' => array( + 'table' => 'node', + 'columns' => array('nid' => 'nid'), + ), + 'term' => array( + 'table' => 'taxonomy_term_data', + 'columns' => array( + 'tid' => 'tid', + ), + ), ), ); @@ -291,8 +304,16 @@ function forum_update_7001() { 'forum_topics' => array('tid', 'sticky', 'last_comment_timestamp'), ), 'foreign keys' => array( - 'node' => 'nid', - 'taxonomy_term_data' => 'tid', + 'tracked_node' => array( + 'table' => 'node', + 'columns' => array('nid' => 'nid'), + ), + 'term' => array( + 'table' => 'taxonomy_term_data', + 'columns' => array( + 'tid' => 'tid', + ), + ), ), ); db_create_table('forum_index', $forum_index); -- cgit v1.2.3