function referral_schema in User Referral 7
Same name and namespace in other branches
- 6 referral.install \referral_schema()
Implements hook_schema().
File
- ./
referral.install, line 11 - Install, update and uninstall functions for the User Referral module.
Code
function referral_schema() {
$schema = array();
$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;
}