You are here

function pet_schema in Previewable email templates 7

Same name and namespace in other branches
  1. 6 pet.install \pet_schema()

Implementation of hook_schema().

File

./pet.install, line 11
Previewable Email Template module install/schema/update hooks.

Code

function pet_schema() {
  $schema = array();
  $schema['pets'] = array(
    'description' => 'Base table for previewable email templates.',
    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'The internal identifier for any template.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
        'description' => 'The machine name of the template.',
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0x1,
        'size' => 'tiny',
        'description' => 'The exportable status of the entity.',
      ),
      'module' => array(
        'description' => 'The name of the providing module if the entity has been defined in code.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'description' => 'The human readable name of the template.',
        'default' => '',
      ),
      'subject' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'description' => 'The template subject.',
        'default' => '',
      ),
      'mail_body' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'description' => 'The template body.',
      ),
      'mail_body_plain' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'description' => 'The template body in plain text form.',
      ),
      'send_plain' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0x0,
        'size' => 'tiny',
        'description' => 'If true send email as plain text.',
      ),
      'recipient_callback' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'description' => 'A recipient callback function, if any.',
        'default' => '',
      ),
      'from_override' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'description' => 'Email to override system from address.',
        'default' => '',
      ),
      'cc_default' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'medium',
        'description' => 'Optional cc emails.',
      ),
      'bcc_default' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'medium',
        'description' => 'Optional bcc emails.',
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}