You are here

function commerce_email_schema in Commerce Email 7

Implements hook_schema().

File

./commerce_email.install, line 11
Install file for Commerce Email Sets default emails and settings

Code

function commerce_email_schema() {
  $schema = array();
  $schema['commerce_email'] = array(
    'description' => 'The base table for emails.',
    'fields' => array(
      'email_id' => array(
        'description' => 'The primary identifier for an email.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The type of email.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'language' => array(
        'description' => 'Language of the email content',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => LANGUAGE_NONE,
      ),
      'template' => array(
        'description' => 'Boolean value indicating whether or not the email is in template or textarea',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'subject' => array(
        'description' => 'The email subject',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'content' => array(
        'description' => 'The email content',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
      'content_format' => array(
        'description' => 'content_format setting',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => NULL,
      ),
    ),
    'primary key' => array(
      'email_id',
    ),
    'unique keys' => array(
      'email_type' => array(
        'type',
        'language',
      ),
    ),
  );
  return $schema;
}