function messaging_schema in Messaging 6.3
Same name and namespace in other branches
- 6.4 messaging.install \messaging_schema()
- 6 messaging.install \messaging_schema()
- 6.2 messaging.install \messaging_schema()
- 7 messaging.install \messaging_schema()
Implementation of hook_schema().
File
- ./
messaging.install, line 6
Code
function messaging_schema() {
$schema['messaging_store'] = array(
'description' => 'Stores queued messages to be sent or sent messages as logs.',
'fields' => array(
'mqid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Unique message id.',
),
'method' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Messaging send method key.',
),
'language' => array(
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
'description' => 'Language code.',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {user}.uid for destination if it is a unique destination.',
),
'destination' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Destination identifier, it may be an email address.',
),
'sender' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {user}.uid who sent the message if any.',
),
'sender_address' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Sender address for this sending method.',
),
'subject' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Message subject, single text line.',
),
'body' => array(
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
'description' => 'Message body, multiple text line.',
),
'data' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
'description' => 'Additional serialized parameters.',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Unix timestamp, when the message was created/stored.',
),
'sent' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Unix timestamp, when the message was sent.',
),
'cron' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Will be 1 if row marked for processing on cron.',
),
'queue' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Will be 1 if this is a queued message.',
),
'log' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Will be 1 if this is a message log.',
),
),
'primary key' => array(
'mqid',
),
'indexes' => array(
'cron' => array(
'cron',
),
'queue' => array(
'queue',
),
'log' => array(
'log',
),
),
);
/*
$schema['messaging_user'] = array(
'description' => 'User variables for messaging',
'fields' => array(
'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'name' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''),
'value' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'text' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
),
'primary key' => array('uid', 'name')
);
*/
$schema['messaging_message_parts'] = array(
'description' => 'Templates for message composition.',
'fields' => array(
'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.',
),
),
'indexes' => array(
'type' => array(
'type',
),
'method' => array(
'method',
),
'msgkey' => array(
'msgkey',
),
),
);
return $schema;
}