about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200508212852_reset_unique_jobs_locks.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20200508212852_reset_unique_jobs_locks.rb b/db/migrate/20200508212852_reset_unique_jobs_locks.rb
new file mode 100644
index 000000000..3ffdeb0aa
--- /dev/null
+++ b/db/migrate/20200508212852_reset_unique_jobs_locks.rb
@@ -0,0 +1,12 @@
+class ResetUniqueJobsLocks < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    # We do this to clean up unique job digests that were not properly
+    # disposed of prior to https://github.com/tootsuite/mastodon/pull/13361
+
+    SidekiqUniqueJobs::Digests.delete_by_pattern('*', count: SidekiqUniqueJobs::Digests.count)
+  end
+
+  def down; end
+end