Code coverage for /20080809/modules/aggregator/aggregator.install

Line #Times calledCode
1
<?php
2
// $Id: aggregator.install,v 1.16 2008/05/15 21:27:32 dries Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
712
function aggregator_install() {
8
  // Create tables.
98
  drupal_install_schema('aggregator');
108
}
11
12
/**
13
 * Implementation of hook_uninstall().
14
 */
1512
function aggregator_uninstall() {
16
  // Remove tables.
171
  drupal_uninstall_schema('aggregator');
18
191
  variable_del('aggregator_allowed_html_tags');
201
  variable_del('aggregator_summary_items');
211
  variable_del('aggregator_clear');
221
  variable_del('aggregator_category_selector');
231
}
24
25
/**
26
 * Implementation of hook_schema().
27
 */
2812
function aggregator_schema() {
299
  $schema['aggregator_category'] = array(
309
    'description' => t('Stores categories for aggregator feeds and feed
items.'),
31
    'fields' => array(
32
      'cid'  => array(
339
        'type' => 'serial',
349
        'not null' => TRUE,
359
        'description' => t('Primary Key: Unique aggregator category ID.'),
369
      ),
37
      'title' => array(
389
        'type' => 'varchar',
399
        'length' => 255,
409
        'not null' => TRUE,
419
        'default' => '',
429
        'description' => t('Title of the category.'),
439
      ),
44
      'description' => array(
459
        'type' => 'text',
469
        'not null' => TRUE,
479
        'size' => 'big',
489
        'description' => t('Description of the category'),
499
      ),
50
      'block' => array(
519
        'type' => 'int',
529
        'not null' => TRUE,
539
        'default' => 0,
549
        'size' => 'tiny',
559
        'description' => t('The number of recent items to show within the
category block.'),
56
      )
579
    ),
589
    'primary key' => array('cid'),
59
    'unique keys' => array(
609
      'title' => array('title'),
619
    ),
62
  );
63
649
  $schema['aggregator_category_feed'] = array(
659
    'description' => t('Bridge table; maps feeds to categories.'),
66
    'fields' => array(
67
      'fid' => array(
689
        'type' => 'int',
699
        'not null' => TRUE,
709
        'default' => 0,
719
        'description' => t("The feed's {aggregator_feed}.fid."),
729
      ),
73
      'cid' => array(
749
        'type' => 'int',
759
        'not null' => TRUE,
769
        'default' => 0,
779
        'description' => t('The {aggregator_category}.cid to which the feed
is being assigned.'),
78
      )
799
    ),
809
    'primary key' => array('cid', 'fid'),
81
    'indexes' => array(
829
      'fid' => array('fid'),
839
    ),
84
  );
85
869
  $schema['aggregator_category_item'] = array(
879
    'description' => t('Bridge table; maps feed items to categories.'),
88
    'fields' => array(
89
      'iid' => array(
909
        'type' => 'int',
919
        'not null' => TRUE,
929
        'default' => 0,
939
        'description' => t("The feed item's {aggregator_item}.iid."),
949
      ),
95
      'cid' => array(
969
        'type' => 'int',
979
        'not null' => TRUE,
989
        'default' => 0,
999
        'description' => t('The {aggregator_category}.cid to which the feed
item is being assigned.'),
100
      )
1019
    ),
1029
    'primary key' => array('cid', 'iid'),
103
    'indexes' => array(
1049
      'iid' => array('iid'),
1059
    ),
106
  );
107
1089
  $schema['aggregator_feed'] = array(
1099
    'description' => t('Stores feeds to be parsed by the aggregator.'),
110
    'fields' => array(
111
      'fid' => array(
1129
        'type' => 'serial',
1139
        'not null' => TRUE,
1149
        'description' => t('Primary Key: Unique feed ID.'),
1159
      ),
116
      'title' => array(
1179
        'type' => 'varchar',
1189
        'length' => 255,
1199
        'not null' => TRUE,
1209
        'default' => '',
1219
        'description' => t('Title of the feed.'),
1229
      ),
123
      'url' => array(
1249
        'type' => 'varchar',
1259
        'length' => 255,
1269
        'not null' => TRUE,
1279
        'default' => '',
1289
        'description' => t('URL to the feed.'),
1299
      ),
130
      'refresh' => array(
1319
        'type' => 'int',
1329
        'not null' => TRUE,
1339
        'default' => 0,
1349
        'description' => t('How often to check for new feed items, in
seconds.'),
1359
      ),
136
      'checked' => array(
1379
        'type' => 'int',
1389
        'not null' => TRUE,
1399
        'default' => 0,
1409
        'description' => t('Last time feed was checked for new items, as
Unix timestamp.'),
1419
      ),
142
      'link' => array(
1439
        'type' => 'varchar',
1449
        'length' => 255,
1459
        'not null' => TRUE,
1469
        'default' => '',
1479
        'description' => t('The parent website of the feed; comes from the
<link> element in the feed.'),
1489
      ),
149
      'description' => array(
1509
        'type' => 'text',
1519
        'not null' => TRUE,
1529
        'size' => 'big',
1539
        'description' => t("The parent website's description; comes from
the <description> element in the feed."),
1549
      ),
155
      'image' => array(
1569
        'type' => 'text',
1579
        'not null' => TRUE,
1589
        'size' => 'big',
1599
        'description' => t('An image representing the feed.'),
1609
      ),
161
      'etag' => array(
1629
        'type' => 'varchar',
1639
        'length' => 255,
1649
        'not null' => TRUE,
1659
        'default' => '',
1669
        'description' => t('Entity tag HTTP response header, used for
validating cache.'),
1679
      ),
168
      'modified' => array(
1699
        'type' => 'int',
1709
        'not null' => TRUE,
1719
        'default' => 0,
1729
        'description' => t('When the feed was last modified, as a Unix
timestamp.'),
1739
      ),
174
      'block' => array(
1759
        'type' => 'int',
1769
        'not null' => TRUE,
1779
        'default' => 0,
1789
        'size' => 'tiny',
1799
        'description' => t("Number of items to display in the feed's
block."),
180
      )
1819
    ),
1829
    'primary key' => array('fid'),
183
    'unique keys' => array(
1849
      'url'  => array('url'),
1859
      'title' => array('title'),
1869
    ),
187
  );
188
1899
  $schema['aggregator_item'] = array(
1909
    'description' => t('Stores the individual items imported from
feeds.'),
191
    'fields' => array(
192
      'iid'  => array(
1939
        'type' => 'serial',
1949
        'not null' => TRUE,
1959
        'description' => t('Primary Key: Unique ID for feed item.'),
1969
      ),
197
      'fid' => array(
1989
        'type' => 'int',
1999
        'not null' => TRUE,
2009
        'default' => 0,
2019
        'description' => t('The {aggregator_feed}.fid to which this item
belongs.'),
2029
      ),
203
      'title' => array(
2049
        'type' => 'varchar',
2059
        'length' => 255,
2069
        'not null' => TRUE,
2079
        'default' => '',
2089
        'description' => t('Title of the feed item.'),
2099
      ),
210
      'link' => array(
2119
        'type' => 'varchar',
2129
        'length' => 255,
2139
        'not null' => TRUE,
2149
        'default' => '',
2159
        'description' => t('Link to the feed item.'),
2169
      ),
217
      'author' => array(
2189
        'type' => 'varchar',
2199
        'length' => 255,
2209
        'not null' => TRUE,
2219
        'default' => '',
2229
        'description' => t('Author of the feed item.'),
2239
      ),
224
      'description' => array(
2259
        'type' => 'text',
2269
        'not null' => TRUE,
2279
        'size' => 'big',
2289
        'description' => t('Body of the feed item.'),
2299
      ),
230
      'timestamp' => array(
2319
        'type' => 'int',
2329
        'not null' => FALSE,
2339
        'description' => t('Posted date of the feed item, as a Unix
timestamp.'),
2349
      ),
235
      'guid' => array(
2369
        'type' => 'varchar',
2379
        'length' => 255,
2389
        'not null' => FALSE,
2399
        'description' => t('Unique identifier for the feed item.'),
240
      )
2419
    ),
2429
    'primary key' => array('iid'),
243
    'indexes' => array(
2449
      'fid' => array('fid'),
2459
    ),
246
  );
247
2489
  return $schema;
2490
}
25012