about summary refs log tree commit diff
path: root/db/post_migrate/20220429101850_clear_email_domain_blocks.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20220429101850_clear_email_domain_blocks.rb')
-rw-r--r--db/post_migrate/20220429101850_clear_email_domain_blocks.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/post_migrate/20220429101850_clear_email_domain_blocks.rb b/db/post_migrate/20220429101850_clear_email_domain_blocks.rb
new file mode 100644
index 000000000..ff525b650
--- /dev/null
+++ b/db/post_migrate/20220429101850_clear_email_domain_blocks.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class ClearEmailDomainBlocks < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  class EmailDomainBlock < ApplicationRecord
+  end
+
+  def up
+    EmailDomainBlock.where.not(parent_id: nil).in_batches.delete_all
+  end
+
+  def down; end
+end