about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-05-09 18:37:39 +0200
committerGitHub <noreply@github.com>2020-05-09 18:37:39 +0200
commit38b69512ffd13abc992a91e33e199881d38bc164 (patch)
tree616436638efd0a567a65e947966d94f0951a9871 /db
parent66fa9f0a04e392294f915b4970adcc0533807abf (diff)
Fix old unique jobs digests not having been cleaned up (#13683)
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200508212852_reset_unique_jobs_locks.rb12
-rw-r--r--db/schema.rb2
2 files changed, 13 insertions, 1 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
diff --git a/db/schema.rb b/db/schema.rb
index 7cbfebb00..08a2335ee 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2020_04_17_125749) do
+ActiveRecord::Schema.define(version: 2020_05_08_212852) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"