View source
<?php
function apply_for_role_schema() {
$schema['apply_for_role_applications'] = array(
'description' => 'Stores email, timestamp, NID and UID for an RSVP',
'fields' => array(
'aid' => array(
'description' => 'Application ID. The primary identifier for the record',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'uid' => array(
'description' => 'The {users}.uid that submitted the application.',
'type' => 'int',
'not null' => TRUE,
),
'rids' => array(
'description' => 'The {role}.rid\'s that a user has applied for, encoded in JSON',
'type' => 'varchar',
'length' => 600,
'not null' => TRUE,
),
'status' => array(
'description' => 'The status of the user application. 0 for not reviewed, 1 for accepted, 2 for denied.',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
'default' => 0,
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Timestamp for when RSVP was created.',
),
'message' => array(
'description' => '(optional) User message explaining application.',
'type' => 'varchar',
'length' => 600,
'not null' => FALSE,
'default' => '',
),
),
'primary key' => array(
'aid',
),
'indexes' => array(
'users' => array(
'uid',
),
),
);
return $schema;
}