Skip to content

Instantly share code, notes, and snippets.

/notify.diff Secret

Created May 4, 2016 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/bb4ff73ad8752622e604221357fa8b19 to your computer and use it in GitHub Desktop.
Save anonymous/bb4ff73ad8752622e604221357fa8b19 to your computer and use it in GitHub Desktop.
diff --git a/lib/Minion/Backend/Pg.pm b/lib/Minion/Backend/Pg.pm
index 765c772..e63d3cb 100644
--- a/lib/Minion/Backend/Pg.pm
+++ b/lib/Minion/Backend/Pg.pm
@@ -750,3 +750,7 @@ drop type if exists minion_state;
-- 8 up
alter table minion_jobs add constraint args check(jsonb_typeof(args) = 'array');
create index on minion_jobs (state, priority desc, created);
+
+-- 9 up
+create trigger minion_jobs_update_retries_trigger after update of retries on
+ minion_jobs for each row execute procedure minion_jobs_insert_notify();
diff --git a/t/pg.t b/t/pg.t
index 02f6726..1a1e7ef 100644
--- a/t/pg.t
+++ b/t/pg.t
@@ -24,10 +24,10 @@ my $worker = $minion->repair->worker;
isa_ok $worker->minion->app, 'Mojolicious', 'has default application';
# Migrate up and down
-is $minion->backend->pg->migrations->active, 8, 'active version is 8';
+is $minion->backend->pg->migrations->active, 9, 'active version is 9';
is $minion->backend->pg->migrations->migrate(0)->active, 0,
'active version is 0';
-is $minion->backend->pg->migrations->migrate->active, 8, 'active version is 8';
+is $minion->backend->pg->migrations->migrate->active, 9, 'active version is 9';
# Register and unregister
$worker->register;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment