You are here

function views_send_schema in Views Send 6

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

Impementation of hook_schema().

See also

http://api.drupal.org/api/function/hook_schema/6

1 call to views_send_schema()
views_send_update_6003 in ./views_send.install
Backend structure is altered for implementing http://drupal.org/node/808058

File

./views_send.install, line 15
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;
}