diff options
Diffstat (limited to 'modules/system')
-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 fb35dcc6b..5effa4410 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -263,7 +263,8 @@ function system_install() { mail varchar(64) default NULL, homepage varchar(255) default NULL, PRIMARY KEY (cid), - KEY lid (nid) + KEY lid (nid), + KEY status (status) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); db_query("CREATE TABLE {node_comment_statistics} ( @@ -739,6 +740,7 @@ function system_install() { PRIMARY KEY (cid) )"); db_query("CREATE INDEX {comments}_nid_idx ON {comments} (nid)"); + db_query("CREATE INDEX {comments}_status_idx ON {comments} (status)"); db_query("CREATE TABLE {node_comment_statistics} ( nid serial CHECK (nid >= 0), @@ -3596,6 +3598,24 @@ function system_update_2002() { } /** + * Add index on comments status column. + */ +function system_update_2003() { + $ret = array(); + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql('ALTER TABLE {comments} ADD KEY status (status)'); + break; + + case 'pgsql': + $ret[] = update_sql("CREATE INDEX {comments}_status_idx ON {comments} (status)"); + break; + } + return $ret; +} + +/** * @} End of "defgroup updates-5.0-to-x.x" * The next series of updates should start at 3000. */ |