From facc6ee6b32df5c51d7f00bda1caa0469d4f71e3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Oct 2016 20:04:19 -0700 Subject: allow hooks to have negative priority --- install/schema_mysql.sql | 3 ++- install/schema_postgres.sql | 4 +++- install/update.php | 12 +++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'install') 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 @@