title: Foreign keys in Drupal 7 schema trouble
body: <p>I have a trouble with Drupal 7 schema for module. There are 4 tables but for sample 2 will be enough:</p>
  
  <pre><code>function mymodule_schema() {
  $schema['series'] = array(
      'fields' =&gt; array(
          'id' =&gt; array(
              'type' =&gt; 'serial',
              'unsigned' =&gt; true,
              'not null' =&gt; true,
          ),
          'name' =&gt; array(
              'type' =&gt; 'varchar',
              'length' =&gt; 255,
              'not null' =&gt; true,
          ),
      ),
      'unique keys' =&gt; array(
          'name' =&gt; array('name'),
      ),
      'primary key' =&gt; array('id'),
  );
  
  $schema['sermon'] = array(
      'fields' =&gt; array(
          'id' =&gt; array(
              'type' =&gt; 'serial',
              'unsigned' =&gt; true,
              'not null' =&gt; true,
          ),
          'title' =&gt; array(
              'type' =&gt; 'varchar',
              'length' =&gt; 255,
              'not null' =&gt; true,
          ),
          'series_id' =&gt; array(
              'type' =&gt; 'int',
          ),
      ),
      'foreign keys' =&gt; array(
          'series_id' =&gt; array(
              'table' =&gt; 'series',
              'columns' =&gt; array('series_id' =&gt; 'id'),
          ),
      ),
      'primary key' =&gt; array('id'),
  );
  return $schema;
  }
  </code></pre>
  
  <p>This code create tables but not foreign keys. Example for implementation I get from Drupal.org: <a href="http://drupal.org/node/146939" rel="nofollow">http://drupal.org/node/146939</a></p>
  
  <p>Drupal version is 7.0-beta 3
  ..As idea: maybe, it isn't implemented yet, I don't see it in <code>node</code> table (documentation example point to code from it's installer).</p>
  
  <p>Thank for your help.</p>