ptalk-8.x-0.x-dev/ptalk.install
ptalk.install
<?php
/**
* Implements hook_schema().
*/
function ptalk_schema() {
$schema['ptalk_message_index'] = array(
'description' => 'Holds indexing information about messages and recipients for fast retrieval.',
'fields' => array(
'id' => array(
'description' => 'ID of the index.',
'type' => 'serial',
'not null' => TRUE,
'unsigned' => TRUE,
),
'mid' => array(
'description' => 'Message ID.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
),
'tid' => array(
'description' => 'Thread ID of the message.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
),
'recipient' => array(
'description' => 'ID of the recipient.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
),
'status' => array(
'description' => 'Indicates if recipient has read the message.',
'type' => 'int',
'default' => 1,
'not null' => TRUE,
'unsigned' => TRUE,
),
'deleted' => array(
'description' => 'Indicates if the message has been deleted.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('id'),
'indexes' => array(
'list' => array('recipient', 'deleted', 'status'),
'messages' => array('mid', 'recipient'),
'participants' => array('tid', 'recipient', 'deleted'),
),
);
$schema['ptalk_thread_index'] = array(
'description' => 'Holds indexing information about participants of the thread for fast retrieval.',
'fields' => array(
'id' => array(
'description' => 'ID of the index.',
'type' => 'serial',
'not null' => TRUE,
'unsigned' => TRUE,
),
'tid' => array(
'description' => 'Thread ID.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
),
'participant' => array(
'description' => 'ID of the participant.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
),
'message_count' => array(
'description' => 'The total number of messages on this thread for the participant.',
'type' => 'int',
'default' => 0,
'not null' => TRUE,
'unsigned' => TRUE,
),
'new_count' => array(
'description' => 'The total number of new messages on this thread for the participant.',
'type' => 'int',
'default' => 0,
'not null' => TRUE,
'unsigned' => TRUE,
),
'status' => array(
'description' => 'Indicates status of the thread for this participant.',
'type' => 'int',
'default' => 1,
'not null' => TRUE,
'unsigned' => TRUE,
),
'deleted' => array(
'description' => 'Indicates if this thread has been deleted for the participant.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('id'),
);
$schema['ptalk_disable'] = array(
'description' => 'Holds the list of users that have disabled private conversations',
'fields' => array(
'uid' => array(
'description' => 'ID of the user',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
),
),
'primary key' => array('uid'),
);
return $schema;
}
