diff --git a/core/includes/update.inc b/core/includes/update.inc
index 7ba1903..4978759 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -468,10 +468,12 @@
           ),
         ),
         'primary key' => array('lid'),
-        'foreign keys' => array(
-          'locales_source' => array(
-            'table' => 'locales_source',
-            'columns' => array('sid' => 'lid'),
+        'metadata' => array(
+          'foreign keys' => array(
+            'locales_source' => array(
+              'table' => 'locales_source',
+              'columns' => array('sid' => 'lid'),
+            ),
           ),
         ),
         'indexes' => array(
diff --git a/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php
index 7618a7c..58fab26 100644
--- a/core/lib/Drupal/Core/Database/Schema.php
+++ b/core/lib/Drupal/Core/Database/Schema.php
@@ -92,15 +92,18 @@
  *  - '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 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
  *    table.
+ *  - 'metadata': An associative array of meta data associated with this table.
+ *    These meta data are a documentation only purpose, and is not mean to be
+ *    functional. Contributed modules can use this information:
+ *    - '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').
  *
  * A key column specifier is either a string naming a column or an
  * array of two elements, column name and length, specifying a prefix
@@ -148,17 +151,19 @@
  *   'unique keys' => array(
  *     'vid' => array('vid'),
  *   ),
- *   'foreign keys' => array(
- *     'node_revision' => array(
- *       'table' => 'node_revision',
- *       'columns' => array('vid' => 'vid'),
- *      ),
- *     'node_author' => array(
- *       'table' => 'users',
- *       'columns' => array('uid' => 'uid'),
+ *   'primary key' => array('nid'),
+ *   'metadata' => array(
+ *     'foreign keys' => array(
+ *       'node_revision' => array(
+ *         'table' => 'node_revision',
+ *         'columns' => array('vid' => 'vid'),
+ *        ),
+ *       'node_author' => array(
+ *         'table' => 'users',
+ *         'columns' => array('uid' => 'uid'),
+ *        ),
  *      ),
  *    ),
- *   'primary key' => array('nid'),
  * );
  * @endcode
  *
diff --git a/core/modules/aggregator/aggregator.install b/core/modules/aggregator/aggregator.install
index bc0a369..16b9e61 100644
--- a/core/modules/aggregator/aggregator.install
+++ b/core/modules/aggregator/aggregator.install
@@ -64,10 +64,12 @@
     'indexes' => array(
       'fid' => array('fid'),
     ),
-    'foreign keys' => array(
-      'aggregator_category' => array(
-        'table' => 'aggregator_category',
-        'columns' => array('cid' => 'cid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'aggregator_category' => array(
+          'table' => 'aggregator_category',
+          'columns' => array('cid' => 'cid'),
+        ),
       ),
     ),
   );
@@ -92,10 +94,12 @@
     'indexes' => array(
       'iid' => array('iid'),
     ),
-    'foreign keys' => array(
-      'aggregator_category' => array(
-        'table' => 'aggregator_category',
-        'columns' => array('cid' => 'cid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'aggregator_category' => array(
+          'table' => 'aggregator_category',
+          'columns' => array('cid' => 'cid'),
+        ),
       ),
     ),
   );
@@ -247,10 +251,12 @@
     'indexes' => array(
       'fid' => array('fid'),
     ),
-    'foreign keys' => array(
-      'aggregator_feed' => array(
-        'table' => 'aggregator_feed',
-        'columns' => array('fid' => 'fid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'aggregator_feed' => array(
+          'table' => 'aggregator_feed',
+          'columns' => array('fid' => 'fid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/block/block.install b/core/modules/block/block.install
index 56b91c3..da4453a 100644
--- a/core/modules/block/block.install
+++ b/core/modules/block/block.install
@@ -128,10 +128,12 @@
     'indexes' => array(
       'rid' => array('rid'),
     ),
-    'foreign keys' => array(
-      'role' => array(
-        'table' => 'role',
-        'columns' => array('rid' => 'rid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'role' => array(
+          'table' => 'role',
+          'columns' => array('rid' => 'rid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install
index f47151f..27011a0 100644
--- a/core/modules/comment/comment.install
+++ b/core/modules/comment/comment.install
@@ -194,14 +194,16 @@
     'unique keys' => array(
       'uuid' => array('uuid'),
     ),
-    'foreign keys' => array(
-      'comment_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'comment_author' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'comment_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'comment_author' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
@@ -255,15 +257,17 @@
       'comment_count' => array('comment_count'),
       'last_comment_uid' => array('last_comment_uid'),
     ),
-    'foreign keys' => array(
-      'statistics_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'last_comment_author' => array(
-        'table' => 'users',
-        'columns' => array(
-          'last_comment_uid' => 'uid',
+    'metadata' => array(
+      'foreign keys' => array(
+        'statistics_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'last_comment_author' => array(
+          'table' => 'users',
+          'columns' => array(
+            'last_comment_uid' => 'uid',
+          ),
         ),
       ),
     ),
diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php
index 22a9ed7..050e3db 100644
--- a/core/modules/field/field.api.php
+++ b/core/modules/field/field.api.php
@@ -219,7 +219,7 @@
  *     specify additional indexes or, at their own risk, modify the default
  *     indexes specified by the field-type module. Some storage engines might
  *     not support indexes.
- *   - foreign keys: (optional) An array of Schema API foreign key definitions.
+ *   - metadata: (optional) An array of Schema API meta data definitions.
  */
 function hook_field_schema($field) {
   if ($field['type'] == 'text_long') {
@@ -252,10 +252,12 @@
     'indexes' => array(
       'format' => array('format'),
     ),
-    'foreign keys' => array(
-      'format' => array(
-        'table' => 'filter_format',
-        'columns' => array('format' => 'format'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'format' => array(
+          'table' => 'filter_format',
+          'columns' => array('format' => 'format'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/field/field.crud.inc b/core/modules/field/field.crud.inc
index b8e2015..d8d1bea 100644
--- a/core/modules/field/field.crud.inc
+++ b/core/modules/field/field.crud.inc
@@ -133,14 +133,14 @@
   // Collect storage information.
   module_load_install($field['module']);
   $schema = (array) module_invoke($field['module'], 'field_schema', $field);
-  $schema += array('columns' => array(), 'indexes' => array(), 'foreign keys' => array());
+  $schema += array('columns' => array(), 'indexes' => array(), 'metadata' => array('foreign keys' => array()));
   // 'columns' are hardcoded in the field type.
   $field['columns'] = $schema['columns'];
   if (array_intersect(array_keys($field['columns']), field_reserved_columns())) {
     throw new FieldException(t('Illegal field type columns.'));
   }
   // 'foreign keys' are hardcoded in the field type.
-  $field['foreign keys'] = $schema['foreign keys'];
+  $field['metadata']['foreign keys'] = $schema['metadata']['foreign keys'];
   // 'indexes' can be both hardcoded in the field type, and specified in the
   // incoming $field definition.
   $field += array(
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index ac0d1b4..fe810b1 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -87,6 +87,7 @@
  *   appear in the 'columns' setting are allowed. Note that field types can
  *   specify default indexes, which can be modified or added to when creating a
  *   field.
+ *   @todo: foreign keys not implemented, only used as metadata.
  * - foreign keys: (optional) An associative array of relations, using the same
  *   structure as the 'foreign keys' definition of hook_schema(). Note,
  *   however, that the field data is not necessarily stored in SQL. Also, the
diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.module b/core/modules/field/modules/field_sql_storage/field_sql_storage.module
index d354f51..9b925ec 100644
--- a/core/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -177,7 +177,7 @@
     ),
   );
 
-  $field += array('columns' => array(), 'indexes' => array(), 'foreign keys' => array());
+  $field += array('columns' => array(), 'indexes' => array(), 'metadata' => array('foreign keys' => array()));
   // Add field columns.
   foreach ($field['columns'] as $column_name => $attributes) {
     $real_name = _field_sql_storage_columnname($field['field_name'], $column_name);
@@ -202,13 +202,13 @@
     }
   }
 
-  // Add foreign keys.
-  foreach ($field['foreign keys'] as $specifier => $specification) {
+  // Add virtual foreign keys.
+  foreach ($field['metadata']['foreign keys'] as $specifier => $specification) {
     $real_name = _field_sql_storage_indexname($field['field_name'], $specifier);
-    $current['foreign keys'][$real_name]['table'] = $specification['table'];
+    $current['metadata']['foreign keys'][$real_name]['table'] = $specification['table'];
     foreach ($specification['columns'] as $column => $referenced) {
       $sql_storage_column = _field_sql_storage_columnname($field['field_name'], $column_name);
-      $current['foreign keys'][$real_name]['columns'][$sql_storage_column] = $referenced;
+      $current['metadata']['foreign keys'][$real_name]['columns'][$sql_storage_column] = $referenced;
     }
   }
 
diff --git a/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php b/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
index 5681f59..2d56469 100644
--- a/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
+++ b/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
@@ -431,12 +431,12 @@
     // Retrieve the field and instance with field_info and verify the foreign
     // keys are in place.
     $field = field_info_field($field_name);
-    $this->assertEqual($field['foreign keys']['format']['table'], 'filter_format', 'Foreign key table name preserved through CRUD');
-    $this->assertEqual($field['foreign keys']['format']['columns']['format'], 'format', 'Foreign key column name preserved through CRUD');
+    $this->assertEqual($field['metadata']['foreign keys']['format']['table'], 'filter_format', 'Foreign key table name preserved through CRUD');
+    $this->assertEqual($field['metadata']['foreign keys']['format']['columns']['format'], 'format', 'Foreign key column name preserved through CRUD');
     // Now grab the SQL schema and verify that too.
     $schema = drupal_get_schema(_field_sql_storage_tablename($field));
-    $this->assertEqual(count($schema['foreign keys']), 1, t("There is 1 foreign key in the schema"));
-    $foreign_key = reset($schema['foreign keys']);
+    $this->assertEqual(count($schema['metadata']['foreign keys']), 1, t("There is 1 foreign key in the schema"));
+    $foreign_key = reset($schema['metadata']['foreign keys']);
     $filter_column = _field_sql_storage_columnname($field['field_name'], 'format');
     $this->assertEqual($foreign_key['table'], 'filter_format', 'Foreign key table name preserved in the schema');
     $this->assertEqual($foreign_key['columns'][$filter_column], 'format', 'Foreign key column name preserved in the schema');
diff --git a/core/modules/field/modules/text/text.install b/core/modules/field/modules/text/text.install
index 72d879f..0669d23 100644
--- a/core/modules/field/modules/text/text.install
+++ b/core/modules/field/modules/text/text.install
@@ -57,10 +57,12 @@
     'indexes' => array(
       'format' => array('format'),
     ),
-    'foreign keys' => array(
-      'format' => array(
-        'table' => 'filter_format',
-        'columns' => array('format' => 'format'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'format' => array(
+          'table' => 'filter_format',
+          'columns' => array('format' => 'format'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 9c37a32..e09ed39 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -962,7 +962,7 @@
  *   fid, FALSE if it doesn't.
  */
 function file_field_find_file_reference_column($field) {
-  foreach ($field['foreign keys'] as $data) {
+  foreach ($field['metadata']['foreign keys'] as $data) {
     if ($data['table'] == 'file_managed') {
       foreach ($data['columns'] as $field_column => $column) {
         if ($column == 'fid') {
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index ca6e1fd..1d534df 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -92,10 +92,12 @@
       'uri' => array('uri'),
     ),
     'primary key' => array('fid'),
-    'foreign keys' => array(
-      'file_owner' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'file_owner' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
@@ -177,10 +179,12 @@
     'indexes' => array(
       'fid' => array('fid'),
     ),
-    'foreign keys' => array(
-      'fid' => array(
-        'table' => 'file_managed',
-        'columns' => array('fid' => 'fid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'fid' => array(
+          'table' => 'file_managed',
+          'columns' => array('fid' => 'fid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install
index 56f8402..cd7181c 100644
--- a/core/modules/forum/forum.install
+++ b/core/modules/forum/forum.install
@@ -159,12 +159,14 @@
       'tid' => array('tid'),
     ),
     'primary key' => array('vid'),
-    'foreign keys' => array(
-      'forum_node' => array(
-        'table' => 'node',
-        'columns' => array(
-          'nid' => 'nid',
-          'vid' => 'vid',
+    'metadata' => array(
+      'foreign keys' => array(
+        'forum_node' => array(
+          'table' => 'node',
+          'columns' => array(
+            'nid' => 'nid',
+            'vid' => 'vid',
+          ),
         ),
       ),
     ),
@@ -227,15 +229,17 @@
       'created' => array('created'),
       'last_comment_timestamp' => array('last_comment_timestamp'),
     ),
-    'foreign keys' => array(
-      'tracked_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'term' => array(
-        'table' => 'taxonomy_term_data',
-        'columns' => array(
-          'tid' => 'tid',
+    'metadata' => array(
+      'foreign keys' => array(
+        'tracked_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'term' => array(
+          'table' => 'taxonomy_term_data',
+          'columns' => array(
+            'tid' => 'tid',
+          ),
         ),
       ),
     ),
diff --git a/core/modules/image/image.install b/core/modules/image/image.install
index e4e77d8..f333aa2 100644
--- a/core/modules/image/image.install
+++ b/core/modules/image/image.install
@@ -62,10 +62,12 @@
     'indexes' => array(
       'fid' => array('fid'),
     ),
-    'foreign keys' => array(
-      'fid' => array(
-        'table' => 'file_managed',
-        'columns' => array('fid' => 'fid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'fid' => array(
+          'table' => 'file_managed',
+          'columns' => array('fid' => 'fid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index f01935a..9a3bac5 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -109,10 +109,12 @@
       ),
     ),
     'primary key' => array('language', 'lid'),
-    'foreign keys' => array(
-      'locales_source' => array(
-        'table' => 'locales_source',
-        'columns' => array('lid' => 'lid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'locales_source' => array(
+          'table' => 'locales_source',
+          'columns' => array('lid' => 'lid'),
+        ),
       ),
     ),
     'indexes' => array(
@@ -156,10 +158,12 @@
       ),
     ),
     'primary key' => array('lid'),
-    'foreign keys' => array(
-      'locales_source' => array(
-        'table' => 'locales_source',
-        'columns' => array('sid' => 'lid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'locales_source' => array(
+          'table' => 'locales_source',
+          'columns' => array('sid' => 'lid'),
+        ),
       ),
     ),
     'indexes' => array(
diff --git a/core/modules/node/node.install b/core/modules/node/node.install
index f9c30a5..0f4b368 100644
--- a/core/modules/node/node.install
+++ b/core/modules/node/node.install
@@ -126,14 +126,16 @@
       'vid' => array('vid'),
       'uuid' => array('uuid'),
     ),
-    'foreign keys' => array(
-      'node_revision' => array(
-        'table' => 'node_revision',
-        'columns' => array('vid' => 'vid'),
-      ),
-      'node_author' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'node_revision' => array(
+          'table' => 'node_revision',
+          'columns' => array('vid' => 'vid'),
+        ),
+        'node_author' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
     'primary key' => array('nid'),
@@ -189,12 +191,14 @@
       ),
     ),
     'primary key' => array('nid', 'gid', 'realm'),
-    'foreign keys' => array(
-      'affected_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'affected_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
       ),
-     ),
+    ),
   );
 
   $schema['node_revision'] = array(
@@ -269,14 +273,16 @@
       'uid' => array('uid'),
     ),
     'primary key' => array('vid'),
-    'foreign keys' => array(
-      'versioned_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'version_author' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'versioned_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'version_author' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/node/tests/modules/node_access_test/node_access_test.install b/core/modules/node/tests/modules/node_access_test/node_access_test.install
index 6b3ef5d..33007c5 100644
--- a/core/modules/node/tests/modules/node_access_test/node_access_test.install
+++ b/core/modules/node/tests/modules/node_access_test/node_access_test.install
@@ -30,10 +30,12 @@
       'nid' => array('nid'),
     ),
     'primary key' => array('nid'),
-    'foreign keys' => array(
-      'versioned_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'versioned_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/poll/poll.install b/core/modules/poll/poll.install
index 75896bb..6a87656 100644
--- a/core/modules/poll/poll.install
+++ b/core/modules/poll/poll.install
@@ -34,10 +34,12 @@
       ),
     ),
     'primary key' => array('nid'),
-    'foreign keys' => array(
-      'poll_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'poll_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
       ),
     ),
   );
@@ -83,10 +85,12 @@
       'nid' => array('nid'),
     ),
     'primary key' => array('chid'),
-    'foreign keys' => array(
-      'choice_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'choice_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
       ),
     ),
   );
@@ -128,14 +132,16 @@
       ),
     ),
     'primary key' => array('nid', 'uid', 'hostname'),
-    'foreign keys' => array(
-      'poll_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'voter' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'poll_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'voter' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
     'indexes' => array(
diff --git a/core/modules/search/search.install b/core/modules/search/search.install
index d5422de..247f0dd 100644
--- a/core/modules/search/search.install
+++ b/core/modules/search/search.install
@@ -86,13 +86,15 @@
     'indexes' => array(
       'sid_type' => array('sid', 'langcode', 'type'),
     ),
-    'foreign keys' => array(
-      'search_dataset' => array(
-        'table' => 'search_dataset',
-        'columns' => array(
-          'sid' => 'sid',
-          'langcode' => 'langcode',
-          'type' => 'type',
+    'metadata' => array(
+      'foreign keys' => array(
+        'search_dataset' => array(
+          'table' => 'search_dataset',
+          'columns' => array(
+            'sid' => 'sid',
+            'langcode' => 'langcode',
+            'type' => 'type',
+          ),
         ),
       ),
     ),
diff --git a/core/modules/shortcut/shortcut.install b/core/modules/shortcut/shortcut.install
index c4023d7..e45bc1a 100644
--- a/core/modules/shortcut/shortcut.install
+++ b/core/modules/shortcut/shortcut.install
@@ -51,10 +51,12 @@
       ),
     ),
     'primary key' => array('set_name'),
-    'foreign keys' => array(
-      'menu_name' => array(
-        'table' => 'menu_links',
-        'columns' => array('set_name' => 'menu_name'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'menu_name' => array(
+          'table' => 'menu_links',
+          'columns' => array('set_name' => 'menu_name'),
+        ),
       ),
     ),
   );
@@ -81,14 +83,16 @@
     'indexes' => array(
       'set_name' => array('set_name'),
     ),
-    'foreign keys' => array(
-      'set_user' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
-      ),
-      'set_name' => array(
-        'table' => 'shortcut_set',
-        'columns' => array('set_name' => 'set_name'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'set_user' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
+        'set_name' => array(
+          'table' => 'shortcut_set',
+          'columns' => array('set_name' => 'set_name'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/statistics/statistics.install b/core/modules/statistics/statistics.install
index 5f2b7dd..2e68481 100644
--- a/core/modules/statistics/statistics.install
+++ b/core/modules/statistics/statistics.install
@@ -83,10 +83,12 @@
       'uid' => array('uid'),
     ),
     'primary key' => array('aid'),
-    'foreign keys' => array(
-      'visitor' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'visitor' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index d10d3e0..061ec1d 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -2663,16 +2663,18 @@
       'nid_vid' => array('nid', 'vid'),
       'vid'     => array('vid')
       ),
-    'foreign keys' => array(
-      'node_revision' => array(
-        'table' => 'node_revision',
-        'columns' => array('vid' => 'vid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'node_revision' => array(
+          'table' => 'node_revision',
+          'columns' => array('vid' => 'vid'),
+          ),
+        'node_author' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid')
+          ),
         ),
-      'node_author' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid')
-        ),
-       ),
+      ),
     'primary key' => array('nid'),
   );
   return $schema;
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index e414238..31c5863 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -1408,10 +1408,12 @@
       'uid' => array('uid'),
       'ssid' => array('ssid'),
     ),
-    'foreign keys' => array(
-      'session_user' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'session_user' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install
index 4122d01..0a20a0f 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.install
+++ b/core/modules/system/tests/modules/entity_test/entity_test.install
@@ -102,9 +102,11 @@
     'indexes' => array(
       'user_id' => array('user_id'),
     ),
-    'foreign keys' => array(
-      'user_id' => array('users' => 'uid'),
-      'id' => array('entity_test' => 'id'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'user_id' => array('users' => 'uid'),
+        'id' => array('entity_test' => 'id'),
+      ),
     ),
     'primary key' => array('id', 'langcode'),
   );
diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index 25d2c06..b3b161c 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -146,10 +146,12 @@
     'unique keys' => array(
       'uuid' => array('uuid'),
     ),
-    'foreign keys' => array(
-      'vocabulary' => array(
-        'table' => 'taxonomy_vocabulary',
-        'columns' => array('vid' => 'vid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'vocabulary' => array(
+          'table' => 'taxonomy_vocabulary',
+          'columns' => array('vid' => 'vid'),
+        ),
       ),
     ),
     'indexes' => array(
@@ -180,10 +182,12 @@
     'indexes' => array(
       'parent' => array('parent'),
     ),
-    'foreign keys' => array(
-      'taxonomy_term_data' => array(
-        'table' => 'taxonomy_term_data',
-        'columns' => array('tid' => 'tid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'taxonomy_term_data' => array(
+          'table' => 'taxonomy_term_data',
+          'columns' => array('tid' => 'tid'),
+        ),
       ),
     ),
     'primary key' => array('tid', 'parent'),
@@ -224,14 +228,16 @@
       'term_node' => array('tid', 'sticky', 'created'),
       'nid' => array('nid'),
     ),
-    'foreign keys' => array(
-      'tracked_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'term' => array(
-        'table' => 'taxonomy_term_data',
-        'columns' => array('tid' => 'tid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'tracked_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'term' => array(
+          'table' => 'taxonomy_term_data',
+          'columns' => array('tid' => 'tid'),
+        ),
       ),
     ),
   );
@@ -254,10 +260,12 @@
     'indexes' => array(
       'tid' => array('tid'),
     ),
-    'foreign keys' => array(
-      'tid' => array(
-        'table' => 'taxonomy_term_data',
-        'columns' => array('tid' => 'tid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'tid' => array(
+          'table' => 'taxonomy_term_data',
+          'columns' => array('tid' => 'tid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/tracker/tracker.install b/core/modules/tracker/tracker.install
index e30da69..07289aa 100644
--- a/core/modules/tracker/tracker.install
+++ b/core/modules/tracker/tracker.install
@@ -58,10 +58,12 @@
       'tracker' => array('published', 'changed'),
     ),
     'primary key' => array('nid'),
-    'foreign keys' => array(
-      'tracked_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'tracked_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
       ),
     ),
   );
@@ -102,14 +104,16 @@
       'tracker' => array('uid', 'published', 'changed'),
     ),
     'primary key' => array('nid', 'uid'),
-    'foreign keys' => array(
-      'tracked_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'tracked_user' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'tracked_node' => array(
+          'table' => 'node',
+          'columns' => array('nid' => 'nid'),
+        ),
+        'tracked_user' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index 3bc837f..22e0e11 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -152,10 +152,12 @@
       'name' => array('name'),
     ),
     'primary key' => array('uid'),
-    'foreign keys' => array(
-      'signature_format' => array(
-        'table' => 'filter_format',
-        'columns' => array('signature_format' => 'format'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'signature_format' => array(
+          'table' => 'filter_format',
+          'columns' => array('signature_format' => 'format'),
+        ),
       ),
     ),
   );
@@ -195,10 +197,12 @@
       'authname' => array('authname'),
     ),
     'primary key' => array('aid'),
-    'foreign keys' => array(
-      'user' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'user' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
       ),
     ),
   );
@@ -264,10 +268,12 @@
     'indexes' => array(
       'permission' => array('permission'),
     ),
-    'foreign keys' => array(
-      'role' => array(
-        'table' => 'role',
-        'columns' => array('rid' => 'rid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'role' => array(
+          'table' => 'role',
+          'columns' => array('rid' => 'rid'),
+        ),
       ),
     ),
   );
@@ -293,14 +299,16 @@
     'indexes' => array(
       'rid' => array('rid'),
     ),
-    'foreign keys' => array(
-      'user' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
-      ),
-      'role' => array(
-        'table' => 'role',
-        'columns' => array('rid' => 'rid'),
+    'metadata' => array(
+      'foreign keys' => array(
+        'user' => array(
+          'table' => 'users',
+          'columns' => array('uid' => 'uid'),
+        ),
+        'role' => array(
+          'table' => 'role',
+          'columns' => array('rid' => 'rid'),
+        ),
       ),
     ),
   );
