Skip to content

Instantly share code, notes, and snippets.

/enum.diff Secret

Created February 5, 2016 17:14
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/d3a2d21b71f2da6cd759 to your computer and use it in GitHub Desktop.
Save anonymous/d3a2d21b71f2da6cd759 to your computer and use it in GitHub Desktop.
diff --git a/lib/Minion/Backend/Pg.pm b/lib/Minion/Backend/Pg.pm
index 145962c..41d6975 100644
--- a/lib/Minion/Backend/Pg.pm
+++ b/lib/Minion/Backend/Pg.pm
@@ -731,3 +731,9 @@ alter table minion_jobs add column attempts int not null default 1;
-- 6 up
drop index minion_jobs_state_idx;
+
+-- 7 up
+create type minion_state as enum ('inactive', 'active', 'finished', 'failed');
+alter table minion_jobs alter column state set default 'inactive'::minion_state;
+alter table minion_jobs
+ alter column state type minion_state using state::minion_state;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment