You are here

function views_send_schema in Views Send 8

Same name and namespace in other branches
  1. 6 views_send.install \views_send_schema()
  2. 7 views_send.install \views_send_schema()

Implements hook_schema().

File

./views_send.install, line 13
The install and update code for the Views Send module.

Code

function views_send_schema() {
  $schema['views_send_spool'] = array(
    'description' => 'Table holds e-mails that are being send on cron.',
    'fields' => array(
      'eid' => array(
        'description' => 'The primary identifier for an e-mail.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The user that has sent the message.',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'The Unix timestamp when the message was added to spool.',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => 'Status: 0 = pending; 1 = sent.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'tentatives' => array(
        'description' => 'How many times we tried to send this message.',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'from_name' => array(
        'description' => 'The real name of the sender.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'from_mail' => array(
        'description' => 'The sender e-mail address.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'to_name' => array(
        'description' => 'The real name of the recipient.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'to_mail' => array(
        'description' => 'The recipient e-mail address.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'subject' => array(
        'description' => 'The e-mail subject.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'body' => array(
        'description' => 'The e-mail body.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
      'headers' => array(
        'description' => 'The e-mail additional headers.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'eid',
    ),
  );
  return $schema;
}