| Commit | Line | Data |
|---|---|---|
| 738b232d | 1 | <?php |
| 4b3cbfb4 OT |
2 | // $Id$ |
| 3 | ||
| 4 | /** | |
| 5 | * @file | |
| 6 | * Install file for privatemsg.module | |
| 7 | */ | |
| 8 | ||
| 738b232d | 9 | |
| 3be9375b OT |
10 | function privatemsg_schema() { |
| 11 | $schema = array(); | |
| 12 | $schema['pm_index'] = array( | |
| e4b16a95 | 13 | 'description' => '{pm_index} holds indexing information about messages and recepients for fast retrieval', |
| 3be9375b | 14 | 'fields' => array( |
| 731ead94 | 15 | 'mid' => array( |
| e4b16a95 | 16 | 'description' => 'Private Message ID', |
| 3be9375b OT |
17 | 'type' => 'int', |
| 18 | 'not null' => TRUE, | |
| 19 | 'unsigned' => TRUE, | |
| 20 | ), | |
| 21 | 'thread_id' => array( | |
| e4b16a95 | 22 | 'description' => 'Messages thread ID', |
| 3be9375b OT |
23 | 'type' => 'int', |
| 24 | 'not null' => TRUE, | |
| 25 | 'unsigned' => TRUE, | |
| 26 | ), | |
| 129e8ef6 | 27 | 'uid' => array( |
| e4b16a95 | 28 | 'description' => 'UID of either the author or the recipient', |
| 3be9375b OT |
29 | 'type' => 'int', |
| 30 | 'not null' => TRUE, | |
| 31 | 'unsigned' => TRUE, | |
| 32 | ), | |
| 129e8ef6 | 33 | 'is_new' => array( |
| e4b16a95 | 34 | 'description' => 'Whether the user has read this message', |
| 2438324b | 35 | 'type' => 'int', |
| 129e8ef6 | 36 | 'default' => 1, |
| 2438324b OT |
37 | 'not null' => TRUE, |
| 38 | 'unsigned' => TRUE, | |
| 39 | ), | |
| 129e8ef6 | 40 | 'deleted' => array( |
| e4b16a95 | 41 | 'description' => 'Whether the user has deleted this message', |
| 129e8ef6 OT |
42 | 'type' => 'int', |
| 43 | 'unsigned' => TRUE, | |
| 44 | 'not null' => TRUE, | |
| 45 | 'default' => 0 | |
| 3be9375b | 46 | ), |
| 129e8ef6 | 47 | |
| 3be9375b OT |
48 | ), |
| 49 | 'indexes' => array( | |
| 129e8ef6 OT |
50 | 'mid' => array('mid'), |
| 51 | 'thread_id' => array('thread_id'), | |
| 52 | 'uid' => array('uid'), | |
| 4b3cbfb4 | 53 | 'is_new' => array('mid', 'uid', 'is_new', ), |
| 3be9375b OT |
54 | ), |
| 55 | ); | |
| 4b3cbfb4 | 56 | |
| 3be9375b | 57 | $schema['pm_message'] = array( |
| e4b16a95 | 58 | 'description' => '{pm_messages} holds the message information', |
| 3be9375b | 59 | 'fields' => array( |
| 731ead94 | 60 | 'mid' => array( |
| e4b16a95 | 61 | 'description' => 'Private Message ID', |
| 3be9375b OT |
62 | 'type' => 'serial', |
| 63 | 'not null' => TRUE, | |
| 64 | 'unsigned' => TRUE, | |
| 65 | ), | |
| 66 | 'author' => array( | |
| e4b16a95 | 67 | 'description' => 'UID of the author', |
| 3be9375b OT |
68 | 'type' => 'int', |
| 69 | 'not null' => TRUE, | |
| 70 | 'unsigned' => TRUE, | |
| 71 | ), | |
| 72 | 'subject' => array( | |
| e4b16a95 | 73 | 'description' => 'Subject text of the message', |
| 3be9375b OT |
74 | 'type' => 'varchar', |
| 75 | 'length' => 255, | |
| 76 | 'not null' => TRUE, | |
| 77 | ), | |
| 78 | 'body' => array( | |
| e4b16a95 | 79 | 'description' => 'Body of the message', |
| 3be9375b OT |
80 | 'type' => 'text', |
| 81 | 'not null' => TRUE, | |
| 82 | 'size' => 'big', | |
| 83 | ), | |
| cb8bd17b SG |
84 | 'format' => array( |
| 85 | 'type' => 'int', | |
| 86 | 'size' => 'small', | |
| 87 | 'not null' => TRUE, | |
| 88 | 'default' => 0, | |
| 89 | 'description' => 'The {filter_formats}.format of the message text.', | |
| 90 | ), | |
| 129e8ef6 | 91 | 'timestamp' => array( |
| e4b16a95 | 92 | 'description' => 'Time when the message was sent', |
| 129e8ef6 OT |
93 | 'type' => 'int', |
| 94 | 'not null' => TRUE, | |
| 95 | 'unsigned' => TRUE, | |
| 96 | ), | |
| 3be9375b | 97 | ), |
| 731ead94 | 98 | 'primary key' => array('mid'), |
| 3be9375b | 99 | 'indexes' => array( |
| 129e8ef6 OT |
100 | 'author' => array('author'), |
| 101 | 'subject' => array(array('subject', 20)), | |
| 102 | 'timestamp' => array('timestamp'), | |
| 3be9375b OT |
103 | ), |
| 104 | ); | |
| 4b3cbfb4 OT |
105 | |
| 106 | ||
| 3be9375b OT |
107 | return $schema; |
| 108 | } | |
| 35f77f17 AH |
109 | |
| 110 | function privatemsg_uninstall() { | |
| b24e2440 OT |
111 | variable_del('private_message_view_template'); |
| 112 | variable_del('privatemsg_per_page'); | |
| 113 | variable_del('privatemsg_display_loginmessage'); | |
| 114 | variable_del('privatemsg_display_fields'); | |
| 19d4e9f3 | 115 | } |