/[drupal]/contributions/modules/simplefeed/simplefeed_item.install
ViewVC logotype

Contents of /contributions/modules/simplefeed/simplefeed_item.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (show annotations) (download) (as text)
Tue Oct 2 17:52:06 2007 UTC (2 years, 1 month ago) by m3avrck
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.8: +8 -21 lines
File MIME type: text/x-php
significant rewrite of processing algorithm, considerably faster, uses less memory, lots of small bug fixes
1 <?php
2 // $Id: simplefeed_item.install,v 1.8 2007/10/01 16:01:01 csevb10 Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function simplefeed_item_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysql':
10 case 'mysqli':
11 db_query("CREATE TABLE {simplefeed_feed_item} (
12 vid int unsigned NOT NULL,
13 nid int unsigned NOT NULL,
14 iid varchar(255) NOT NULL,
15 fid int unsigned NOT NULL,
16 expires int unsigned NOT NULL default '0',
17 url varchar(255) NOT NULL,
18 PRIMARY KEY (vid),
19 KEY nid (nid),
20 KEY iid (iid),
21 KEY fid (fid)
22 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
23 break;
24 case 'pgsql':
25 db_query("CREATE TABLE {simplefeed_feed_item} (
26 vid int_unsigned NOT NULL,
27 nid int_unsigned NOT NULL,
28 iid varchar(255) NOT NULL,
29 fid int_unsigned NOT NULL,
30 expires int_unsigned NOT NULL default '0',
31 url varchar(255) NOT NULL,
32 PRIMARY KEY (vid)
33 )");
34 db_query("CREATE INDEX {simplefeed_feed_item}_nid_idx ON {simplefeed_feed_item} (nid)");
35 db_query("CREATE INDEX {simplefeed_feed_item}_url_idx ON {simplefeed_feed_item} (iid)");
36 db_query("CREATE INDEX {simplefeed_feed_item}_fid_idx ON {simplefeed_feed_item} (fid)");
37 break;
38 }
39
40 drupal_set_message(t('SimpleFeed Item successfully installed.'));
41 }
42
43 /**
44 * Implementation of hook_uninstall().
45 */
46 function simplefeed_item_uninstall() {
47 db_query('DROP TABLE {simplefeed_feed_item}');
48 node_type_delete('feed_item');
49 }

  ViewVC Help
Powered by ViewVC 1.1.2