You are here

function referral_schema in User Referral 6

Same name and namespace in other branches
  1. 7 referral.install \referral_schema()

Implementation of hook_schema().

File

./referral.install, line 6

Code

function referral_schema() {
  $schema['referral'] = array(
    'fields' => array(
      'uid' => array(
        'description' => t('The {users}.uid of the user who was invited.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'referral_uid' => array(
        'description' => t('The {users}.uid of the referer.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'created' => array(
        'description' => t('UNIX timestamp for when the user was registered.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'flag' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'flag_timestamp' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'host' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Network address.'),
      ),
      'http_referer' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('URL of referer site.'),
      ),
    ),
    'primary key' => array(
      'uid',
    ),
    'indexes' => array(
      'referral_uid' => array(
        'referral_uid',
      ),
    ),
  );
  return $schema;
}