You are here

function mail_logger_schema in Mail Logger 6

Same name and namespace in other branches
  1. 7 mail_logger.install \mail_logger_schema()

Implementation of hook_schema().

File

./mail_logger.install, line 10
Install and update functions for Mail Logger module.

Code

function mail_logger_schema() {
  $schema = array();
  $schema['mail_logger'] = array(
    'description' => 'Mail Logger table stores outgoing mails',
    'fields' => array(
      'mlid' => array(
        'description' => 'Mail Logger entry ID',
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'mailkey' => array(
        'description' => 'a key identifying the mail type',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'mail_to' => array(
        'description' => 'to whom this mail is going',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'subject' => array(
        'description' => 'Mail subject',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'body' => array(
        'description' => 'Body text of the mail',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
      'mail_from' => array(
        'description' => 'the FROM email address',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'headers' => array(
        'description' => 'Headers of the outgoing mail',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
      'date_sent' => array(
        'description' => 'Mail Logger entry ID',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'language' => array(
        'description' => 'Language code',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'mlid',
    ),
    'indexes' => array(
      'mail_to' => array(
        'mail_to',
      ),
      'mail_from' => array(
        'mail_from',
      ),
      'subject' => array(
        array(
          'subject',
          20,
        ),
      ),
      'date_sent' => array(
        'date_sent',
      ),
      'language' => array(
        'language',
      ),
    ),
  );
  return $schema;
}