aggregator.install 1.99 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php

function aggregator_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {aggregator_category} (
        cid int(10) NOT NULL auto_increment,
        title varchar(255) NOT NULL default '',
        description longtext NOT NULL,
        block tinyint(2) NOT NULL default '0',
        PRIMARY KEY (cid),
        UNIQUE KEY title (title)
      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      db_query("CREATE TABLE {aggregator_category_feed} (
        fid int(10) NOT NULL default '0',
        cid int(10) NOT NULL default '0',
        PRIMARY KEY (fid,cid)
      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      db_query("CREATE TABLE {aggregator_category_item} (
        iid int(10) NOT NULL default '0',
        cid int(10) NOT NULL default '0',
        PRIMARY KEY (iid,cid)
      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      db_query("CREATE TABLE {aggregator_feed} (
        fid int(10) NOT NULL auto_increment,
        title varchar(255) NOT NULL default '',
        url varchar(255) NOT NULL default '',
        refresh int(10) NOT NULL default '0',
        checked int(10) NOT NULL default '0',
        link varchar(255) NOT NULL default '',
        description longtext NOT NULL,
        image longtext NOT NULL,
        etag varchar(255) NOT NULL default '',
        modified int(10) NOT NULL default '0',
        block tinyint(2) NOT NULL default '0',
        PRIMARY KEY (fid),
        UNIQUE KEY link (url),
        UNIQUE KEY title (title)
      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      db_query("CREATE TABLE {aggregator_item} (
        iid int(10) NOT NULL auto_increment,
        fid int(10) NOT NULL default '0',
        title varchar(255) NOT NULL default '',
        link varchar(255) NOT NULL default '',
        author varchar(255) NOT NULL default '',
        description longtext NOT NULL,
        timestamp int(11) default NULL,
        PRIMARY KEY (iid)
      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      break;
  }
}