summaryrefslogtreecommitdiff
path: root/modules/aggregator/aggregator.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-05-25 12:46:46 +0000
committerDries Buytaert <dries@buytaert.net>2007-05-25 12:46:46 +0000
commit3cafffe63f70f418d0b6ca32ac5e0f3e27dceb41 (patch)
treecd59a40556a084f35b7b5a3bc3caa50874087541 /modules/aggregator/aggregator.install
parentae762838c0e92bded86370103df4583874c50da7 (diff)
downloadbrdo-3cafffe63f70f418d0b6ca32ac5e0f3e27dceb41.tar.gz
brdo-3cafffe63f70f418d0b6ca32ac5e0f3e27dceb41.tar.bz2
- Killer patch #144765 by bjaspan, frando et al: schema API 1 hits core. Oh, behave.
Diffstat (limited to 'modules/aggregator/aggregator.install')
-rw-r--r--modules/aggregator/aggregator.install119
1 files changed, 5 insertions, 114 deletions
diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install
index 9cc59cc2d..8c44c33a7 100644
--- a/modules/aggregator/aggregator.install
+++ b/modules/aggregator/aggregator.install
@@ -5,126 +5,17 @@
* Implementation of hook_install().
*/
function aggregator_install() {
- switch ($GLOBALS['db_type']) {
- case 'mysql':
- case 'mysqli':
- db_query("CREATE TABLE {aggregator_category} (
- cid int NOT NULL auto_increment,
- title varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- block tinyint 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 NOT NULL default '0',
- cid int NOT NULL default '0',
- PRIMARY KEY (fid,cid)
- ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
- db_query("CREATE TABLE {aggregator_category_item} (
- iid int NOT NULL default '0',
- cid int NOT NULL default '0',
- PRIMARY KEY (iid,cid)
- ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
- db_query("CREATE TABLE {aggregator_feed} (
- fid int NOT NULL auto_increment,
- title varchar(255) NOT NULL default '',
- url varchar(255) NOT NULL default '',
- refresh int NOT NULL default '0',
- checked int 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 NOT NULL default '0',
- block tinyint 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 NOT NULL auto_increment,
- fid int 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 default NULL,
- guid varchar(255),
- PRIMARY KEY (iid),
- KEY fid (fid)
- ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
- break;
- case 'pgsql':
- db_query("CREATE TABLE {aggregator_category} (
- cid serial,
- title varchar(255) NOT NULL default '',
- description text NOT NULL,
- block smallint NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE (title)
- )");
-
- db_query("CREATE TABLE {aggregator_category_feed} (
- fid int NOT NULL default '0',
- cid int NOT NULL default '0',
- PRIMARY KEY (fid,cid)
- )");
-
- db_query("CREATE TABLE {aggregator_category_item} (
- iid int NOT NULL default '0',
- cid int NOT NULL default '0',
- PRIMARY KEY (iid,cid)
- )");
-
- db_query("CREATE TABLE {aggregator_feed} (
- fid serial,
- title varchar(255) NOT NULL default '',
- url varchar(255) NOT NULL default '',
- refresh int NOT NULL default '0',
- checked int NOT NULL default '0',
- link varchar(255) NOT NULL default '',
- description text NOT NULL default '',
- image text NOT NULL default '',
- etag varchar(255) NOT NULL default '',
- modified int NOT NULL default '0',
- block smallint NOT NULL default '0',
- PRIMARY KEY (fid),
- UNIQUE (url),
- UNIQUE (title)
- )");
-
- db_query("CREATE TABLE {aggregator_item} (
- iid serial,
- fid int NOT NULL default '0',
- title varchar(255) NOT NULL default '',
- link varchar(255) NOT NULL default '',
- author varchar(255) NOT NULL default '',
- description text NOT NULL,
- timestamp int default NULL,
- guid varchar(255),
- PRIMARY KEY (iid)
- )");
- db_query("CREATE INDEX {aggregator_item}_fid_idx ON {aggregator_item} (fid)");
-
- break;
- }
+ // Create tables.
+ drupal_install_schema('aggregator');
}
/**
* Implementation of hook_uninstall().
*/
function aggregator_uninstall() {
- db_query('DROP TABLE {aggregator_category}');
- db_query('DROP TABLE {aggregator_category_feed}');
- db_query('DROP TABLE {aggregator_category_item}');
- db_query('DROP TABLE {aggregator_feed}');
- db_query('DROP TABLE {aggregator_item}');
+ // Remove tables.
+ drupal_uninstall_schema('aggregator');
+
variable_del('aggregator_allowed_html_tags');
variable_del('aggregator_summary_items');
variable_del('aggregator_clear');