diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 3 | ||||
-rw-r--r-- | install/schema_postgres.sql | 4 | ||||
-rw-r--r-- | install/update.php | 12 |
3 files changed, 16 insertions, 3 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index d72684a90..4cbcfc64d 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -504,10 +504,11 @@ CREATE TABLE IF NOT EXISTS `hook` ( `hook` char(255) NOT NULL DEFAULT '', `file` char(255) NOT NULL DEFAULT '', `fn` char(255) NOT NULL DEFAULT '', - `priority` int(11) unsigned NOT NULL DEFAULT '0', + `priority` smallint NOT NULL DEFAULT '0', `hook_version` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `hook` (`hook`), + KEY `priority` (`priority`), KEY `hook_version` (`hook_version`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index ab9a5cff4..a682aa49d 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -492,13 +492,15 @@ CREATE TABLE "hook" ( "hook" text NOT NULL, "file" text NOT NULL, "fn" text NOT NULL, - "priority" bigint NOT NULL DEFAULT '0', + "priority" smallint 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 index "hook_priority_idx" on hook ("priority"); + 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 921d16e2f..07a94b161 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1183 ); +define( 'UPDATE_VERSION' , 1184 ); /** * @@ -2444,3 +2444,13 @@ function update_r1182() { return UPDATE_SUCCESS; return UPDATE_FAILED; } + + +function update_r1183() { + $r1 = q("alter table hook CHANGE priority priority smallint NOT NULL DEFAULT '0' "); + $r2 = q("create index priority on hook (priority)"); + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +}
\ No newline at end of file |