'foreign keys': An associative array of foreign keys ('keyname' => specification). Each specification is an array with 'table' and 'columns' elements that form a foreign key for the table.
'table' is a string specifying the foreign table, and 'columns' is an associative array in the format 'source_column' => 'target_column'.
Note: Foreign key definitions were added in Drupal 7 for documentation purposes only, and do not modify the database.
Example from the {node} table:
'foreign keys' => array(
'node_revision' => array(
'table' => 'node_revision',
'columns' => array('vid' => 'vid'),
),
'node_author' => array(
'table' => 'users',
'columns' => array('uid' => 'uid')
),
),
Comments
Comment #1
simon georges commentedPatch applies cleanly and doesn't seem to break anything.
I still have to check if there is something to do for D6 -> D7 upgrade.
Thanks, anyway !
Comment #2
miro_dietikerThank you for the schema update.
Please note that regarding the index, we'll need to implement the hook_update_700x to allow already-installed 7.x-1.x installations to have a clean database...
Please avoid non-functional changes in a functional patch. (things like code cleanup...)
Comment #3
pillarsdotnet commentedCorrected and re-rolled.
Comment #4
miro_dietikerThank you.
BTW: The patch provided a parse error because of a missing bracket. Please review yourself first or at least write if something is completely untested..
Committed. Pushing soon.