/[drupal]/contributions/modules/bot/bot_drupal/bot_drupal.install
ViewVC logotype

Contents of /contributions/modules/bot/bot_drupal/bot_drupal.install

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


Revision 1.3 - (show annotations) (download) (as text)
Thu Nov 16 21:03:01 2006 UTC (3 years ago) by morbus
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
Changes since 1.2: +14 -1 lines
File MIME type: text/x-php
Channels are now textfield, bot_drupal shows page of popular and recent URLs along with their title, minor tweaks and bugfixes.
1 <?php
2 // $Id: bot_drupal.install,v 1.2 2006/11/14 05:00:38 morbus Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function bot_drupal_update_1() {
8 $ret = array();
9 switch ($GLOBALS['db_type']) {
10 case 'mysql':
11 case 'mysqli':
12 $ret[] = update_sql("CREATE TABLE {bot_urls} (
13 url varchar(255) NOT NULL default '',
14 count int unsigned NOT NULL default '0',
15 last_seen int NOT NULL default '0'
16 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
17 break;
18 case 'pgsql':
19 $ret[] = update_sql("CREATE TABLE {bot_urls} (
20 url varchar(255) NOT NULL default '',
21 count integer NOT NULL default '0',
22 last_seen integer NOT NULL default '0'
23 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
24 break;
25 }
26 return $ret;
27 }
28
29 function bot_drupal_update_2() {
30 $ret = array();
31 switch ($GLOBALS['db_type']) {
32 case 'mysql':
33 case 'mysqli':
34 $ret[] = update_sql("ALTER TABLE {bot_urls} ADD title varchar(128) NOT NULL default '' AFTER url");
35 break;
36 case 'pgsql':
37 $ret[] = update_sql("ALTER TABLE {bot_urls} ALTER COLUMN title varchar(128) NOT NULL default ''");
38 break;
39 }
40 return $ret;
41 }

  ViewVC Help
Powered by ViewVC 1.1.2