diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-12 20:04:19 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-12 20:04:19 -0700 |
commit | facc6ee6b32df5c51d7f00bda1caa0469d4f71e3 (patch) | |
tree | 6e519117a19b01d9ad29bbf8028f0f59ad494b05 | |
parent | 9a2f86e9ad3afadfafab59568bec6749a75478ab (diff) | |
download | volse-hubzilla-facc6ee6b32df5c51d7f00bda1caa0469d4f71e3.tar.gz volse-hubzilla-facc6ee6b32df5c51d7f00bda1caa0469d4f71e3.tar.bz2 volse-hubzilla-facc6ee6b32df5c51d7f00bda1caa0469d4f71e3.zip |
allow hooks to have negative priority
-rwxr-xr-x | boot.php | 2 | ||||
-rw-r--r-- | install/schema_mysql.sql | 3 | ||||
-rw-r--r-- | install/schema_postgres.sql | 4 | ||||
-rw-r--r-- | install/update.php | 12 |
4 files changed, 17 insertions, 4 deletions
@@ -47,7 +47,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '1.15' ); define ( 'ZOT_REVISION', '1.1' ); -define ( 'DB_UPDATE_VERSION', 1183 ); +define ( 'DB_UPDATE_VERSION', 1184 ); /** 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 |