diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-11-24 11:00:15 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-11-24 11:00:15 +0000 |
commit | 08564574055f2ea3be4c5817a18f775ba80843dd (patch) | |
tree | 9806b7652e7074adcc59b8bcaaf077ad6aa8c7ce /modules/system/system.install | |
parent | 7782ea28047c1f7ed635675e2cf61d952af5223c (diff) | |
download | brdo-08564574055f2ea3be4c5817a18f775ba80843dd.tar.gz brdo-08564574055f2ea3be4c5817a18f775ba80843dd.tar.bz2 |
- Patch #99128 by robertDouglass and RobRoy: added an index to the watchdog tab.le.
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index da0936e16..030b503c3 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -541,7 +541,8 @@ function system_install() { referer varchar(128) NOT NULL default '', hostname varchar(128) NOT NULL default '', timestamp int NOT NULL default '0', - PRIMARY KEY (wid) + PRIMARY KEY (wid), + KEY (type) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); break; @@ -1007,6 +1008,7 @@ function system_install() { timestamp int NOT NULL default '0', PRIMARY KEY (wid) )"); + db_query("CREATE INDEX {watchdog}_type_idx ON {watchdog} (type)"); break; } @@ -3069,6 +3071,24 @@ function system_update_182() { } /** + * Add an index on watchdog type. + */ +function system_update_183() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql('ALTER TABLE {watchdog} ADD INDEX (type)'); + break; + case 'pgsql': + $ret[] = update_sql('CREATE INDEX {watchdog}_type_idx ON {watchdog}(type)'); + break; + } + return $ret; +} + + +/** * @defgroup updates-4.7-to-5.0 System updates from 4.7 to 5.0 * @{ */ |