function aggregator_install in Drupal 5
Same name and namespace in other branches
- 6 modules/aggregator/aggregator.install \aggregator_install()
Implementation of hook_install().
File
- modules/
aggregator/ aggregator.install, line 6
Code
function aggregator_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {aggregator_category} (\n cid int NOT NULL auto_increment,\n title varchar(255) NOT NULL default '',\n description longtext NOT NULL,\n block tinyint NOT NULL default '0',\n PRIMARY KEY (cid),\n UNIQUE KEY title (title)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_category_feed} (\n fid int NOT NULL default '0',\n cid int NOT NULL default '0',\n PRIMARY KEY (fid,cid)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_category_item} (\n iid int NOT NULL default '0',\n cid int NOT NULL default '0',\n PRIMARY KEY (iid,cid)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_feed} (\n fid int NOT NULL auto_increment,\n title varchar(255) NOT NULL default '',\n url varchar(255) NOT NULL default '',\n refresh int NOT NULL default '0',\n checked int NOT NULL default '0',\n link varchar(255) NOT NULL default '',\n description longtext NOT NULL,\n image longtext NOT NULL,\n etag varchar(255) NOT NULL default '',\n modified int NOT NULL default '0',\n block tinyint NOT NULL default '0',\n PRIMARY KEY (fid),\n UNIQUE KEY link (url),\n UNIQUE KEY title (title)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_item} (\n iid int NOT NULL auto_increment,\n fid int NOT NULL default '0',\n title varchar(255) NOT NULL default '',\n link varchar(255) NOT NULL default '',\n author varchar(255) NOT NULL default '',\n description longtext NOT NULL,\n timestamp int default NULL,\n guid varchar(255),\n PRIMARY KEY (iid),\n KEY fid (fid)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
case 'pgsql':
db_query("CREATE TABLE {aggregator_category} (\n cid serial,\n title varchar(255) NOT NULL default '',\n description text NOT NULL,\n block smallint NOT NULL default '0',\n PRIMARY KEY (cid),\n UNIQUE (title)\n )");
db_query("CREATE TABLE {aggregator_category_feed} (\n fid int NOT NULL default '0',\n cid int NOT NULL default '0',\n PRIMARY KEY (fid,cid)\n )");
db_query("CREATE TABLE {aggregator_category_item} (\n iid int NOT NULL default '0',\n cid int NOT NULL default '0',\n PRIMARY KEY (iid,cid)\n )");
db_query("CREATE TABLE {aggregator_feed} (\n fid serial,\n title varchar(255) NOT NULL default '',\n url varchar(255) NOT NULL default '',\n refresh int NOT NULL default '0',\n checked int NOT NULL default '0',\n link varchar(255) NOT NULL default '',\n description text NOT NULL default '',\n image text NOT NULL default '',\n etag varchar(255) NOT NULL default '',\n modified int NOT NULL default '0',\n block smallint NOT NULL default '0',\n PRIMARY KEY (fid),\n UNIQUE (url),\n UNIQUE (title)\n )");
db_query("CREATE TABLE {aggregator_item} (\n iid serial,\n fid int NOT NULL default '0',\n title varchar(255) NOT NULL default '',\n link varchar(255) NOT NULL default '',\n author varchar(255) NOT NULL default '',\n description text NOT NULL,\n timestamp int default NULL,\n guid varchar(255),\n PRIMARY KEY (iid)\n )");
db_query("CREATE INDEX {aggregator_item}_fid_idx ON {aggregator_item} (fid)");
break;
}
}