mirror of https://github.com/mastodon/mastodon
				
				
				
			Add some missing indexes on foreign keys (#18157)
							parent
							
								
									d55154819e
								
							
						
					
					
						commit
						9b4024a389
					
				@ -0,0 +1,7 @@
 | 
			
		||||
class AddIndexStatusesOnAccountId < ActiveRecord::Migration[6.1]
 | 
			
		||||
  disable_ddl_transaction!
 | 
			
		||||
 | 
			
		||||
  def change
 | 
			
		||||
    add_index :statuses, [:account_id], name: :index_statuses_on_account_id, algorithm: :concurrently
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
class AddIndexStatusesPinsOnStatusId < ActiveRecord::Migration[6.1]
 | 
			
		||||
  disable_ddl_transaction!
 | 
			
		||||
 | 
			
		||||
  def change
 | 
			
		||||
    add_index :status_pins, [:status_id], name: :index_status_pins_on_status_id, algorithm: :concurrently
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
class AddIndexReportsOnAssignedAccountId < ActiveRecord::Migration[6.1]
 | 
			
		||||
  disable_ddl_transaction!
 | 
			
		||||
 | 
			
		||||
  def change
 | 
			
		||||
    add_index :reports, [:assigned_account_id], name: :index_reports_on_assigned_account_id, algorithm: :concurrently, where: 'assigned_account_id IS NOT NULL'
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
class AddIndexReportsOnActionTakenByAccountId < ActiveRecord::Migration[6.1]
 | 
			
		||||
  disable_ddl_transaction!
 | 
			
		||||
 | 
			
		||||
  def change
 | 
			
		||||
    add_index :reports, [:action_taken_by_account_id], name: :index_reports_on_action_taken_by_account_id, algorithm: :concurrently, where: 'action_taken_by_account_id IS NOT NULL'
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue