You are here

function sms_track_schema in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_track/sms_track.install \sms_track_schema()
  2. 6 modules/sms_track/sms_track.install \sms_track_schema()

Implements hook_schema().

1 call to sms_track_schema()
sms_track_update_7001 in modules/sms_track/sms_track.install
Change the 'status' field from tinyint to smallint.

File

modules/sms_track/sms_track.install, line 14
SMS Framework Message Tracking feature module: Install file.

Code

function sms_track_schema() {
  $schema['sms_track'] = array(
    'description' => 'Message tracking archive.',
    'fields' => array(
      'id' => array(
        'description' => 'The primary identifier.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'reference' => array(
        'description' => 'Reference code of message. Enough for an md5 hash.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => FALSE,
      ),
      'dir' => array(
        'description' => '0=out 1=in.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'number' => array(
        'description' => 'If direction=0 this is recipient. If direction=1 this is sender.',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
      ),
      'gw_number' => array(
        'description' => 'If direction=0 this is sender. If direction=1 this is recipient.',
        'type' => 'varchar',
        'length' => 20,
        'not null' => FALSE,
      ),
      'message' => array(
        'description' => 'Message text.',
        'type' => 'text',
        'size' => 'normal',
        'not null' => FALSE,
      ),
      'status' => array(
        'description' => 'Message delivery status. See constants.',
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'created' => array(
        'description' => 'The creation timestamp.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'updated' => array(
        'description' => 'The modification timestamp.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'options' => array(
        'description' => 'Options used when sending/receiving message.',
        'type' => 'text',
        'size' => 'normal',
        'not null' => FALSE,
      ),
      'log' => array(
        'description' => 'An array of status changes.',
        'type' => 'text',
        'size' => 'normal',
        'not null' => FALSE,
      ),
      // Additional Author and Recipient fields.
      'author' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "Author's {users}.uid.",
        'default' => 0,
      ),
      'recipient' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "Recipient's {users}.uid.",
        'default' => 0,
      ),
    ),
    'unique keys' => array(),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}