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:
		
					parent
					
						
							
								7b0fe4aef9
							
						
					
				
			
			
				commit
				
					
						f6d35ed57d
					
				
			
		
					 9 changed files with 43 additions and 114 deletions
				
			
		|  | @ -5,7 +5,7 @@ class AddAutofollowToInvites < ActiveRecord::Migration[5.2] | |||
| 
 | ||||
|   disable_ddl_transaction! | ||||
| 
 | ||||
|   def change | ||||
|   def up | ||||
|     safety_assured do | ||||
|       add_column_with_default :invites, :autofollow, :bool, default: false, allow_null: false | ||||
|     end | ||||
|  |  | |||
|  | @ -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 | ||||
							
								
								
									
										14
									
								
								db/post_migrate/20220429101850_clear_email_domain_blocks.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								db/post_migrate/20220429101850_clear_email_domain_blocks.rb
									
										
									
									
									
										Normal 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 | ||||
|  | @ -10,7 +10,7 @@ | |||
| # | ||||
| # It's strongly recommended that you check this file into your version control system. | ||||
| 
 | ||||
| ActiveRecord::Schema.define(version: 2022_04_28_114902) do | ||||
| ActiveRecord::Schema.define(version: 2022_04_29_101850) do | ||||
| 
 | ||||
|   # These are extensions that must be enabled in order to support this database | ||||
|   enable_extension "plpgsql" | ||||
|  | @ -389,8 +389,6 @@ ActiveRecord::Schema.define(version: 2022_04_28_114902) do | |||
|     t.datetime "created_at", null: false | ||||
|     t.datetime "updated_at", null: false | ||||
|     t.bigint "parent_id" | ||||
|     t.inet "ips", array: true | ||||
|     t.datetime "last_refresh_at" | ||||
|     t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true | ||||
|   end | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue