You are here

function fb_user_schema in Drupal for Facebook 7.4

Same name and namespace in other branches
  1. 6.3 fb_user.install \fb_user_schema()
  2. 6.2 fb_user.install \fb_user_schema()
  3. 7.3 fb_user.install \fb_user_schema()

Implements hook_schema().

Define a simple table for mapping local uids to facebook user ids.

File

./fb_user.install, line 14
Install file for fb_user.module.

Code

function fb_user_schema() {
  $schema['fb_user'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fbu' => array(
        // http://forum.developers.facebook.net/viewtopic.php?pid=4676
        'type' => 'int',
        'size' => 'big',
        'not null' => TRUE,
      ),
    ),
    // Assume mappings are one to one.  While theoretically this doesn't have to be the case, it's almost always what is wanted.
    'primary key' => array(
      'uid',
    ),
    'unique keys' => array(
      'fbu' => array(
        'fbu',
      ),
    ),
  );
  return $schema;
}