annotate modules/aggregator/aggregator.install @ 15:4347c45bb494 6.7

Drupal 6.7
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:44 +0100
parents c1f4ac30525a
children 3edae6ecd6c6
rev   line source
webmaster@1 1 <?php
webmaster@15 2 // $Id: aggregator.install,v 1.14.2.1 2008/11/09 13:22:35 goba Exp $
webmaster@1 3
webmaster@1 4 /**
webmaster@1 5 * Implementation of hook_install().
webmaster@1 6 */
webmaster@1 7 function aggregator_install() {
webmaster@1 8 // Create tables.
webmaster@1 9 drupal_install_schema('aggregator');
webmaster@1 10 }
webmaster@1 11
webmaster@1 12 /**
webmaster@1 13 * Implementation of hook_uninstall().
webmaster@1 14 */
webmaster@1 15 function aggregator_uninstall() {
webmaster@1 16 // Remove tables.
webmaster@1 17 drupal_uninstall_schema('aggregator');
webmaster@1 18
webmaster@1 19 variable_del('aggregator_allowed_html_tags');
webmaster@1 20 variable_del('aggregator_summary_items');
webmaster@1 21 variable_del('aggregator_clear');
webmaster@1 22 variable_del('aggregator_category_selector');
webmaster@1 23 }
webmaster@1 24
webmaster@1 25 /**
webmaster@1 26 * Implementation of hook_schema().
webmaster@1 27 */
webmaster@1 28 function aggregator_schema() {
webmaster@1 29 $schema['aggregator_category'] = array(
webmaster@1 30 'description' => t('Stores categories for aggregator feeds and feed items.'),
webmaster@1 31 'fields' => array(
webmaster@1 32 'cid' => array(
webmaster@1 33 'type' => 'serial',
webmaster@1 34 'not null' => TRUE,
webmaster@1 35 'description' => t('Primary Key: Unique aggregator category ID.'),
webmaster@1 36 ),
webmaster@1 37 'title' => array(
webmaster@1 38 'type' => 'varchar',
webmaster@1 39 'length' => 255,
webmaster@1 40 'not null' => TRUE,
webmaster@1 41 'default' => '',
webmaster@1 42 'description' => t('Title of the category.'),
webmaster@1 43 ),
webmaster@1 44 'description' => array(
webmaster@1 45 'type' => 'text',
webmaster@1 46 'not null' => TRUE,
webmaster@1 47 'size' => 'big',
webmaster@1 48 'description' => t('Description of the category'),
webmaster@1 49 ),
webmaster@1 50 'block' => array(
webmaster@1 51 'type' => 'int',
webmaster@1 52 'not null' => TRUE,
webmaster@1 53 'default' => 0,
webmaster@1 54 'size' => 'tiny',
webmaster@1 55 'description' => t('The number of recent items to show within the category block.'),
webmaster@1 56 )
webmaster@1 57 ),
webmaster@1 58 'primary key' => array('cid'),
webmaster@1 59 'unique keys' => array('title' => array('title')),
webmaster@1 60 );
webmaster@1 61
webmaster@1 62 $schema['aggregator_category_feed'] = array(
webmaster@1 63 'description' => t('Bridge table; maps feeds to categories.'),
webmaster@1 64 'fields' => array(
webmaster@1 65 'fid' => array(
webmaster@1 66 'type' => 'int',
webmaster@1 67 'not null' => TRUE,
webmaster@1 68 'default' => 0,
webmaster@1 69 'description' => t("The feed's {aggregator_feed}.fid."),
webmaster@1 70 ),
webmaster@1 71 'cid' => array(
webmaster@1 72 'type' => 'int',
webmaster@1 73 'not null' => TRUE,
webmaster@1 74 'default' => 0,
webmaster@1 75 'description' => t('The {aggregator_category}.cid to which the feed is being assigned.'),
webmaster@1 76 )
webmaster@1 77 ),
webmaster@1 78 'primary key' => array('cid', 'fid'),
webmaster@1 79 'indexes' => array('fid' => array('fid')),
webmaster@1 80 );
webmaster@1 81
webmaster@1 82 $schema['aggregator_category_item'] = array(
webmaster@1 83 'description' => t('Bridge table; maps feed items to categories.'),
webmaster@1 84 'fields' => array(
webmaster@1 85 'iid' => array(
webmaster@1 86 'type' => 'int',
webmaster@1 87 'not null' => TRUE,
webmaster@1 88 'default' => 0,
webmaster@1 89 'description' => t("The feed item's {aggregator_item}.iid."),
webmaster@1 90 ),
webmaster@1 91 'cid' => array(
webmaster@1 92 'type' => 'int',
webmaster@1 93 'not null' => TRUE,
webmaster@1 94 'default' => 0,
webmaster@1 95 'description' => t('The {aggregator_category}.cid to which the feed item is being assigned.'),
webmaster@1 96 )
webmaster@1 97 ),
webmaster@1 98 'primary key' => array('cid', 'iid'),
webmaster@1 99 'indexes' => array('iid' => array('iid')),
webmaster@1 100 );
webmaster@1 101
webmaster@1 102 $schema['aggregator_feed'] = array(
webmaster@1 103 'description' => t('Stores feeds to be parsed by the aggregator.'),
webmaster@1 104 'fields' => array(
webmaster@1 105 'fid' => array(
webmaster@1 106 'type' => 'serial',
webmaster@1 107 'not null' => TRUE,
webmaster@1 108 'description' => t('Primary Key: Unique feed ID.'),
webmaster@1 109 ),
webmaster@1 110 'title' => array(
webmaster@1 111 'type' => 'varchar',
webmaster@1 112 'length' => 255,
webmaster@1 113 'not null' => TRUE,
webmaster@1 114 'default' => '',
webmaster@1 115 'description' => t('Title of the feed.'),
webmaster@1 116 ),
webmaster@1 117 'url' => array(
webmaster@1 118 'type' => 'varchar',
webmaster@1 119 'length' => 255,
webmaster@1 120 'not null' => TRUE,
webmaster@1 121 'default' => '',
webmaster@1 122 'description' => t('URL to the feed.'),
webmaster@1 123 ),
webmaster@1 124 'refresh' => array(
webmaster@1 125 'type' => 'int',
webmaster@1 126 'not null' => TRUE,
webmaster@1 127 'default' => 0,
webmaster@1 128 'description' => t('How often to check for new feed items, in seconds.'),
webmaster@1 129 ),
webmaster@1 130 'checked' => array(
webmaster@1 131 'type' => 'int',
webmaster@1 132 'not null' => TRUE,
webmaster@1 133 'default' => 0,
webmaster@1 134 'description' => t('Last time feed was checked for new items, as Unix timestamp.'),
webmaster@1 135 ),
webmaster@1 136 'link' => array(
webmaster@1 137 'type' => 'varchar',
webmaster@1 138 'length' => 255,
webmaster@1 139 'not null' => TRUE,
webmaster@1 140 'default' => '',
webmaster@15 141 'description' => t('The parent website of the feed; comes from the &lt;link&gt; element in the feed.'),
webmaster@1 142 ),
webmaster@1 143 'description' => array(
webmaster@1 144 'type' => 'text',
webmaster@1 145 'not null' => TRUE,
webmaster@1 146 'size' => 'big',
webmaster@15 147 'description' => t("The parent website's description; comes from the &lt;description&gt; element in the feed."),
webmaster@1 148 ),
webmaster@1 149 'image' => array(
webmaster@1 150 'type' => 'text',
webmaster@1 151 'not null' => TRUE,
webmaster@1 152 'size' => 'big',
webmaster@1 153 'description' => t('An image representing the feed.'),
webmaster@1 154 ),
webmaster@1 155 'etag' => array(
webmaster@1 156 'type' => 'varchar',
webmaster@1 157 'length' => 255,
webmaster@1 158 'not null' => TRUE,
webmaster@1 159 'default' => '',
webmaster@1 160 'description' => t('Entity tag HTTP response header, used for validating cache.'),
webmaster@1 161 ),
webmaster@1 162 'modified' => array(
webmaster@1 163 'type' => 'int',
webmaster@1 164 'not null' => TRUE,
webmaster@1 165 'default' => 0,
webmaster@1 166 'description' => t('When the feed was last modified, as a Unix timestamp.'),
webmaster@1 167 ),
webmaster@1 168 'block' => array(
webmaster@1 169 'type' => 'int',
webmaster@1 170 'not null' => TRUE,
webmaster@1 171 'default' => 0,
webmaster@1 172 'size' => 'tiny',
webmaster@1 173 'description' => t("Number of items to display in the feed's block."),
webmaster@1 174 )
webmaster@1 175 ),
webmaster@1 176 'primary key' => array('fid'),
webmaster@1 177 'unique keys' => array(
webmaster@1 178 'url' => array('url'),
webmaster@1 179 'title' => array('title'),
webmaster@1 180 ),
webmaster@1 181 );
webmaster@1 182
webmaster@1 183 $schema['aggregator_item'] = array(
webmaster@1 184 'description' => t('Stores the individual items imported from feeds.'),
webmaster@1 185 'fields' => array(
webmaster@1 186 'iid' => array(
webmaster@1 187 'type' => 'serial',
webmaster@1 188 'not null' => TRUE,
webmaster@1 189 'description' => t('Primary Key: Unique ID for feed item.'),
webmaster@1 190 ),
webmaster@1 191 'fid' => array(
webmaster@1 192 'type' => 'int',
webmaster@1 193 'not null' => TRUE,
webmaster@1 194 'default' => 0,
webmaster@1 195 'description' => t('The {aggregator_feed}.fid to which this item belongs.'),
webmaster@1 196 ),
webmaster@1 197 'title' => array(
webmaster@1 198 'type' => 'varchar',
webmaster@1 199 'length' => 255,
webmaster@1 200 'not null' => TRUE,
webmaster@1 201 'default' => '',
webmaster@1 202 'description' => t('Title of the feed item.'),
webmaster@1 203 ),
webmaster@1 204 'link' => array(
webmaster@1 205 'type' => 'varchar',
webmaster@1 206 'length' => 255,
webmaster@1 207 'not null' => TRUE,
webmaster@1 208 'default' => '',
webmaster@1 209 'description' => t('Link to the feed item.'),
webmaster@1 210 ),
webmaster@1 211 'author' => array(
webmaster@1 212 'type' => 'varchar',
webmaster@1 213 'length' => 255,
webmaster@1 214 'not null' => TRUE,
webmaster@1 215 'default' => '',
webmaster@1 216 'description' => t('Author of the feed item.'),
webmaster@1 217 ),
webmaster@1 218 'description' => array(
webmaster@1 219 'type' => 'text',
webmaster@1 220 'not null' => TRUE,
webmaster@1 221 'size' => 'big',
webmaster@1 222 'description' => t('Body of the feed item.'),
webmaster@1 223 ),
webmaster@1 224 'timestamp' => array(
webmaster@1 225 'type' => 'int',
webmaster@1 226 'not null' => FALSE,
webmaster@1 227 'description' => t('Post date of feed item, as a Unix timestamp.'),
webmaster@1 228 ),
webmaster@1 229 'guid' => array(
webmaster@1 230 'type' => 'varchar',
webmaster@1 231 'length' => 255,
webmaster@1 232 'not null' => FALSE,
webmaster@1 233 'description' => t('Unique identifier for the feed item.'),
webmaster@1 234 )
webmaster@1 235 ),
webmaster@1 236 'primary key' => array('iid'),
webmaster@1 237 'indexes' => array('fid' => array('fid')),
webmaster@1 238 );
webmaster@1 239
webmaster@1 240 return $schema;
webmaster@1 241 }