You are here

function mailhandler_schema in Mailhandler 6.2

Same name and namespace in other branches
  1. 6 mailhandler.install \mailhandler_schema()
  2. 7.2 mailhandler.install \mailhandler_schema()
  3. 7 mailhandler.install \mailhandler_schema()

Mailhandler 2's schema.

File

./mailhandler.install, line 35
Install, update and uninstall functions for the Mailhandler module.

Code

function mailhandler_schema() {
  $schema['mailhandler_mailbox'] = array(
    'description' => 'Table storing mailbox definitions',
    'fields' => array(
      'mail' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Unique email address of this mailbox. Used to identify it programmatically.',
      ),
      'mid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'settings' => array(
        'type' => 'text',
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'Configuration of mailhandler mailbox.',
        'object default' => array(
          'type' => 'imap',
          'folder' => 'INBOX',
          'port' => 993,
          'insecure' => 1,
          'extraimap' => '',
          'limit' => 0,
          'encoding' => 'UTF-8',
          'fromheader' => 'From',
          'retrieve' => 'MailhandlerPhpImapRetrieve',
          'domain' => '',
          'name' => '',
          'pass' => '',
          'delete_after_read' => 0,
          'security' => 0,
          'replies' => 0,
          'readonly' => 0,
        ),
      ),
      'admin_title' => array(
        'type' => 'varchar',
        'length' => '255',
        'description' => 'Human-readable name (email address) of this mailbox.',
      ),
    ),
    'primary key' => array(
      'mid',
    ),
    'unique keys' => array(
      'mail' => array(
        'mail',
      ),
    ),
    'export' => array(
      'key' => 'mail',
      'key name' => 'Email address',
      'primary key' => 'mid',
      'identifier' => 'mailbox',
      'api' => array(
        'owner' => 'mailhandler',
        'api' => 'mailhandler_mailbox',
        'minimum_version' => 2,
        'current_version' => 2,
      ),
    ),
  );
  return $schema;
}