You are here

function messaging_template_schema in Messaging 6.4

Same name and namespace in other branches
  1. 6.3 messaging_template/messaging_template.install \messaging_template_schema()

Implementation of hook_schema().

File

messaging_template/messaging_template.install, line 6

Code

function messaging_template_schema() {
  $schema['messaging_message_parts'] = array(
    'description' => 'Templates for message composition.',
    'fields' => array(
      'tpid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Unique template part id.',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Message group key.',
      ),
      'method' => array(
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Messaging send method.',
      ),
      'msgkey' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Message part key, should be unique within a group (header, footer,..).',
      ),
      'module' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Module that owns this template.',
      ),
      'message' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'description' => 'Message template, multiline text with tokens for replacement.',
      ),
      'language' => array(
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Language code.',
      ),
      'format' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The input format used by this text.',
      ),
      'data' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'Additional serialized parameters.',
      ),
    ),
    'primary key' => array(
      'tpid',
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
      'method' => array(
        'method',
      ),
      'msgkey' => array(
        'msgkey',
      ),
      'language' => array(
        'language',
      ),
    ),
  );
  return $schema;
}