diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-08-22 13:55:53 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-08-22 13:55:53 +0000 |
commit | db5368027e7b38a274e17bf002f543a0ffbbd7ae (patch) | |
tree | 95d6bbe06b2a58ddbad9e345523f4da2e6dfbe68 /includes/database | |
parent | 39d6704418f4a072f7157a524d4742a6c4e4f593 (diff) | |
download | brdo-db5368027e7b38a274e17bf002f543a0ffbbd7ae.tar.gz brdo-db5368027e7b38a274e17bf002f543a0ffbbd7ae.tar.bz2 |
- Patch #880132 by bojanz: hook_schema() doesn't support compound foreign keys; inconsistent implementations in core.
Diffstat (limited to 'includes/database')
-rw-r--r-- | includes/database/schema.inc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/includes/database/schema.inc b/includes/database/schema.inc index 2c3309562..187f9e6b8 100644 --- a/includes/database/schema.inc +++ b/includes/database/schema.inc @@ -75,10 +75,11 @@ * - 'unique keys': An associative array of unique keys ('keyname' => * specification). Each specification is an array of one or more * key column specifiers (see below) that form a unique key on the table. - * - 'foreign keys': An associative array, each key references a column - * of the local table, each value is an array with a single key pair as - * 'tablename' => 'column' where 'column' is the foreign column to - * reference. + * - 'foreign keys': An associative array of relations ('my_relation' => + * specification). Each specification is an array containing the name of + * the referenced table ('table'), and an array of column mappings + * ('columns'). Column mappings are defined by key pairs ('source_column' => + * 'referenced_column'). * - 'indexes': An associative array of indexes ('indexname' => * specification). Each specification is an array of one or more * key column specifiers (see below) that form an index on the @@ -131,8 +132,14 @@ * 'vid' => array('vid'), * ), * 'foreign keys' => array( - * 'vid' => array('node_revision' => 'vid'), - * 'uid' => array('users' => 'uid'), + * 'node_revision' => array( + * 'table' => 'node_revision', + * 'columns' => array('vid' => 'vid'), + * ), + * 'node_author' => array( + * 'table' => 'users', + * 'columns' => array('uid' => 'uid'), + * ), * ), * 'primary key' => array('nid'), * ); |