Mercurial > defr > drupal > core
comparison modules/comment/comment.install @ 19:3edae6ecd6c6 6.9
Drupal 6.9
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Thu, 15 Jan 2009 10:15:56 +0100 |
| parents | c1f4ac30525a |
| children |
comparison
equal
deleted
inserted
replaced
| 18:f5131a9cd9e5 | 19:3edae6ecd6c6 |
|---|---|
| 1 <?php | 1 <?php |
| 2 // $Id: comment.install,v 1.19 2008/01/16 21:45:30 goba Exp $ | 2 // $Id: comment.install,v 1.19.2.1 2009/01/06 15:46:36 goba Exp $ |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * Implementation of hook_enable(). | 5 * Implementation of hook_enable(). |
| 6 */ | 6 */ |
| 7 function comment_enable() { | 7 function comment_enable() { |
| 71 /** | 71 /** |
| 72 * Implementation of hook_schema(). | 72 * Implementation of hook_schema(). |
| 73 */ | 73 */ |
| 74 function comment_schema() { | 74 function comment_schema() { |
| 75 $schema['comments'] = array( | 75 $schema['comments'] = array( |
| 76 'description' => t('Stores comments and associated data.'), | 76 'description' => 'Stores comments and associated data.', |
| 77 'fields' => array( | 77 'fields' => array( |
| 78 'cid' => array( | 78 'cid' => array( |
| 79 'type' => 'serial', | 79 'type' => 'serial', |
| 80 'not null' => TRUE, | 80 'not null' => TRUE, |
| 81 'description' => t('Primary Key: Unique comment ID.'), | 81 'description' => 'Primary Key: Unique comment ID.', |
| 82 ), | 82 ), |
| 83 'pid' => array( | 83 'pid' => array( |
| 84 'type' => 'int', | 84 'type' => 'int', |
| 85 'not null' => TRUE, | 85 'not null' => TRUE, |
| 86 'default' => 0, | 86 'default' => 0, |
| 87 'description' => t('The {comments}.cid to which this comment is a reply. If set to 0, this comment is not a reply to an existing comment.'), | 87 'description' => 'The {comments}.cid to which this comment is a reply. If set to 0, this comment is not a reply to an existing comment.', |
| 88 ), | 88 ), |
| 89 'nid' => array( | 89 'nid' => array( |
| 90 'type' => 'int', | 90 'type' => 'int', |
| 91 'not null' => TRUE, | 91 'not null' => TRUE, |
| 92 'default' => 0, | 92 'default' => 0, |
| 93 'description' => t('The {node}.nid to which this comment is a reply.'), | 93 'description' => 'The {node}.nid to which this comment is a reply.', |
| 94 ), | 94 ), |
| 95 'uid' => array( | 95 'uid' => array( |
| 96 'type' => 'int', | 96 'type' => 'int', |
| 97 'not null' => TRUE, | 97 'not null' => TRUE, |
| 98 'default' => 0, | 98 'default' => 0, |
| 99 'description' => t('The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.'), | 99 'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.', |
| 100 ), | 100 ), |
| 101 'subject' => array( | 101 'subject' => array( |
| 102 'type' => 'varchar', | 102 'type' => 'varchar', |
| 103 'length' => 64, | 103 'length' => 64, |
| 104 'not null' => TRUE, | 104 'not null' => TRUE, |
| 105 'default' => '', | 105 'default' => '', |
| 106 'description' => t('The comment title.'), | 106 'description' => 'The comment title.', |
| 107 ), | 107 ), |
| 108 'comment' => array( | 108 'comment' => array( |
| 109 'type' => 'text', | 109 'type' => 'text', |
| 110 'not null' => TRUE, | 110 'not null' => TRUE, |
| 111 'size' => 'big', | 111 'size' => 'big', |
| 112 'description' => t('The comment body.'), | 112 'description' => 'The comment body.', |
| 113 ), | 113 ), |
| 114 'hostname' => array( | 114 'hostname' => array( |
| 115 'type' => 'varchar', | 115 'type' => 'varchar', |
| 116 'length' => 128, | 116 'length' => 128, |
| 117 'not null' => TRUE, | 117 'not null' => TRUE, |
| 118 'default' => '', | 118 'default' => '', |
| 119 'description' => t("The author's host name."), | 119 'description' => "The author's host name.", |
| 120 ), | 120 ), |
| 121 'timestamp' => array( | 121 'timestamp' => array( |
| 122 'type' => 'int', | 122 'type' => 'int', |
| 123 'not null' => TRUE, | 123 'not null' => TRUE, |
| 124 'default' => 0, | 124 'default' => 0, |
| 125 'description' => t('The time that the comment was created, or last edited by its author, as a Unix timestamp.'), | 125 'description' => 'The time that the comment was created, or last edited by its author, as a Unix timestamp.', |
| 126 ), | 126 ), |
| 127 'status' => array( | 127 'status' => array( |
| 128 'type' => 'int', | 128 'type' => 'int', |
| 129 'unsigned' => TRUE, | 129 'unsigned' => TRUE, |
| 130 'not null' => TRUE, | 130 'not null' => TRUE, |
| 131 'default' => 0, | 131 'default' => 0, |
| 132 'size' => 'tiny', | 132 'size' => 'tiny', |
| 133 'description' => t('The published status of a comment. (0 = Published, 1 = Not Published)'), | 133 'description' => 'The published status of a comment. (0 = Published, 1 = Not Published)', |
| 134 ), | 134 ), |
| 135 'format' => array( | 135 'format' => array( |
| 136 'type' => 'int', | 136 'type' => 'int', |
| 137 'size' => 'small', | 137 'size' => 'small', |
| 138 'not null' => TRUE, | 138 'not null' => TRUE, |
| 139 'default' => 0, | 139 'default' => 0, |
| 140 'description' => t('The {filter_formats}.format of the comment body.'), | 140 'description' => 'The {filter_formats}.format of the comment body.', |
| 141 ), | 141 ), |
| 142 'thread' => array( | 142 'thread' => array( |
| 143 'type' => 'varchar', | 143 'type' => 'varchar', |
| 144 'length' => 255, | 144 'length' => 255, |
| 145 'not null' => TRUE, | 145 'not null' => TRUE, |
| 146 'description' => t("The vancode representation of the comment's place in a thread."), | 146 'description' => "The vancode representation of the comment's place in a thread.", |
| 147 ), | 147 ), |
| 148 'name' => array( | 148 'name' => array( |
| 149 'type' => 'varchar', | 149 'type' => 'varchar', |
| 150 'length' => 60, | 150 'length' => 60, |
| 151 'not null' => FALSE, | 151 'not null' => FALSE, |
| 152 'description' => t("The comment author's name. Uses {users}.name if the user is logged in, otherwise uses the value typed into the comment form."), | 152 'description' => "The comment author's name. Uses {users}.name if the user is logged in, otherwise uses the value typed into the comment form.", |
| 153 ), | 153 ), |
| 154 'mail' => array( | 154 'mail' => array( |
| 155 'type' => 'varchar', | 155 'type' => 'varchar', |
| 156 'length' => 64, | 156 'length' => 64, |
| 157 'not null' => FALSE, | 157 'not null' => FALSE, |
| 158 'description' => t("The comment author's e-mail address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on."), | 158 'description' => "The comment author's e-mail address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.", |
| 159 ), | 159 ), |
| 160 'homepage' => array( | 160 'homepage' => array( |
| 161 'type' => 'varchar', | 161 'type' => 'varchar', |
| 162 'length' => 255, | 162 'length' => 255, |
| 163 'not null' => FALSE, | 163 'not null' => FALSE, |
| 164 'description' => t("The comment author's home page address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on."), | 164 'description' => "The comment author's home page address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.", |
| 165 ) | 165 ) |
| 166 ), | 166 ), |
| 167 'indexes' => array( | 167 'indexes' => array( |
| 168 'pid' => array('pid'), | 168 'pid' => array('pid'), |
| 169 'nid' => array('nid'), | 169 'nid' => array('nid'), |
| 171 ), | 171 ), |
| 172 'primary key' => array('cid'), | 172 'primary key' => array('cid'), |
| 173 ); | 173 ); |
| 174 | 174 |
| 175 $schema['node_comment_statistics'] = array( | 175 $schema['node_comment_statistics'] = array( |
| 176 'description' => t('Maintains statistics of node and comments posts to show "new" and "updated" flags.'), | 176 'description' => 'Maintains statistics of node and comments posts to show "new" and "updated" flags.', |
| 177 'fields' => array( | 177 'fields' => array( |
| 178 'nid' => array( | 178 'nid' => array( |
| 179 'type' => 'int', | 179 'type' => 'int', |
| 180 'unsigned' => TRUE, | 180 'unsigned' => TRUE, |
| 181 'not null' => TRUE, | 181 'not null' => TRUE, |
| 182 'default' => 0, | 182 'default' => 0, |
| 183 'description' => t('The {node}.nid for which the statistics are compiled.'), | 183 'description' => 'The {node}.nid for which the statistics are compiled.', |
| 184 ), | 184 ), |
| 185 'last_comment_timestamp' => array( | 185 'last_comment_timestamp' => array( |
| 186 'type' => 'int', | 186 'type' => 'int', |
| 187 'not null' => TRUE, | 187 'not null' => TRUE, |
| 188 'default' => 0, | 188 'default' => 0, |
| 189 'description' => t('The Unix timestamp of the last comment that was posted within this node, from {comments}.timestamp.'), | 189 'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comments}.timestamp.', |
| 190 ), | 190 ), |
| 191 'last_comment_name' => array( | 191 'last_comment_name' => array( |
| 192 'type' => 'varchar', | 192 'type' => 'varchar', |
| 193 'length' => 60, | 193 'length' => 60, |
| 194 'not null' => FALSE, | 194 'not null' => FALSE, |
| 195 'description' => t('The name of the latest author to post a comment on this node, from {comments}.name.'), | 195 'description' => 'The name of the latest author to post a comment on this node, from {comments}.name.', |
| 196 ), | 196 ), |
| 197 'last_comment_uid' => array( | 197 'last_comment_uid' => array( |
| 198 'type' => 'int', | 198 'type' => 'int', |
| 199 'not null' => TRUE, | 199 'not null' => TRUE, |
| 200 'default' => 0, | 200 'default' => 0, |
| 201 'description' => t('The user ID of the latest author to post a comment on this node, from {comments}.uid.'), | 201 'description' => 'The user ID of the latest author to post a comment on this node, from {comments}.uid.', |
| 202 ), | 202 ), |
| 203 'comment_count' => array( | 203 'comment_count' => array( |
| 204 'type' => 'int', | 204 'type' => 'int', |
| 205 'unsigned' => TRUE, | 205 'unsigned' => TRUE, |
| 206 'not null' => TRUE, | 206 'not null' => TRUE, |
| 207 'default' => 0, | 207 'default' => 0, |
| 208 'description' => t('The total number of comments on this node.'), | 208 'description' => 'The total number of comments on this node.', |
| 209 ), | 209 ), |
| 210 ), | 210 ), |
| 211 'primary key' => array('nid'), | 211 'primary key' => array('nid'), |
| 212 'indexes' => array( | 212 'indexes' => array( |
| 213 'node_comment_timestamp' => array('last_comment_timestamp') | 213 'node_comment_timestamp' => array('last_comment_timestamp') |
