Remove IP matching from e-mail domain blocks (#18190)

Clear out e-mail domain blocks created from automatically resolved DNS records
This commit is contained in:
Eugen Rochko
2022-04-29 23:27:03 +02:00
committed by GitHub
parent 7b0fe4aef9
commit f6d35ed57d
9 changed files with 43 additions and 114 deletions

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
class RemoveIpsFromEmailDomainBlocks < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def change
safety_assured do
remove_column :email_domain_blocks, :ips, :inet, array: true
remove_column :email_domain_blocks, :last_refresh_at, :datetime
end
end
end

View File

@@ -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