diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 4 | ||||
-rw-r--r-- | install/schema_postgres.sql | 2 | ||||
-rw-r--r-- | install/update.php | 15 |
3 files changed, 19 insertions, 2 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 01cf97674..c36bfaa57 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -517,8 +517,10 @@ CREATE TABLE IF NOT EXISTS `hook` ( `file` char(255) NOT NULL DEFAULT '', `function` char(255) NOT NULL DEFAULT '', `priority` int(11) unsigned NOT NULL DEFAULT '0', + `hook_version` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `hook` (`hook`) + KEY `hook` (`hook`), + KEY `hook_version` (`hook_version`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `hubloc` ( diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index a7cd5875c..d4bb54b1e 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -512,10 +512,12 @@ CREATE TABLE "hook" ( "file" text NOT NULL, "function" text NOT NULL, "priority" bigint NOT NULL DEFAULT '0', + "hook_version" smallint NOT NULL DEFAULT '0', PRIMARY KEY ("id") ); create index "hook_idx" on hook ("hook"); +create index "hook_version_idx" on hook ("hook_version"); CREATE TABLE "hubloc" ( "hubloc_id" serial NOT NULL, "hubloc_guid" text NOT NULL DEFAULT '', diff --git a/install/update.php b/install/update.php index bfd01494f..2dc4a6db3 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1165 ); +define( 'UPDATE_VERSION' , 1166 ); /** * @@ -2058,3 +2058,16 @@ function update_r1164() { return UPDATE_FAILED; } +function update_r1165() { + + $r1 = q("alter table hook add hook_version int not null default '0' "); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) + $r2 = q("create index \"hook_version_idx\" on hook (\"hook_version\") "); + else + $r2 = q("alter table hook add index ( hook_version ) "); + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + |