#320328 by litwol: Do not show private messages menu block to anonymous users
[project/privatemsg.git] / privatemsg.install
1 <?php
2
3 function privatemsg_schema() {
4 $schema = array();
5 $schema['pm_index'] = array(
6 'description' => t('{pm_index} holds indexing information about messages and recepients for fast retrieval'),
7 'fields' => array(
8 'mid' => array(
9 'description' => t('Private Message ID'),
10 'type' => 'int',
11 'not null' => TRUE,
12 'unsigned' => TRUE,
13 ),
14 'thread_id' => array(
15 'description' => t('Messages thread ID'),
16 'type' => 'int',
17 'not null' => TRUE,
18 'unsigned' => TRUE,
19 ),
20 'recipient' => array(
21 'description' => t('UID of the recipient'),
22 'type' => 'int',
23 'not null' => TRUE,
24 'unsigned' => TRUE,
25 ),
26 'author' => array(
27 'description' => t('UID of the author'),
28 'type' => 'int',
29 'not null' => TRUE,
30 'unsigned' => TRUE,
31 ),
32 'timestamp' => array(
33 'description' => t('Time when the message was sent'),
34 'type' => 'int',
35 'not null' => TRUE,
36 'unsigned' => TRUE,
37 ),
38 'new' => array(
39 'description' => t('Whether the user read his message'),
40 'type' => 'int',
41 'default' => 1,
42 'not null' => TRUE,
43 'unsigned' => TRUE,
44 ),
45 ),
46 'indexes' => array(
47 '`mid`' => array('`mid`'),
48 '`author`' => array('`author`'),
49 '`thread_id`' => array('`thread_id`'),
50 '`recipient`' => array('`recipient`'),
51 '`timestamp`' => array('`timestamp`'),
52 '`new`' => array('`mid`','`recipient`','`new`',),
53 ),
54 );
55
56 $schema['pm_message'] = array(
57 'description' => t('{pm_messages} holds the message information'),
58 'fields' => array(
59 'mid' => array(
60 'description' => t('Private Message ID'),
61 'type' => 'serial',
62 'not null' => TRUE,
63 'unsigned' => TRUE,
64 ),
65 'author' => array(
66 'description' => t('UID of the author'),
67 'type' => 'int',
68 'not null' => TRUE,
69 'unsigned' => TRUE,
70 ),
71 'subject' => array(
72 'description' => t('Subject text of the message'),
73 'type' => 'varchar',
74 'length' => 255,
75 'not null' => TRUE,
76 ),
77 'body' => array(
78 'description' => t('Body of the message'),
79 'type' => 'text',
80 'not null' => TRUE,
81 'size' => 'big',
82 ),
83 ),
84 'primary key' => array('mid'),
85 'indexes' => array(
86 '`author`' => array('`author`'),
87 '`subject`' => array(array('`subject`', 20)),
88 ),
89 );
90
91
92 return $schema;
93 }
94 function privatemsg_install() {
95 drupal_install_schema('privatemsg');
96
97 }
98
99 function privatemsg_uninstall() {
100 drupal_uninstall_schema('privatemsg');
101 }