Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class <%= migration_class_name %> < <%= migration_parent %>
disable_ddl_transaction!

def self.up
fix_index_order_for [:associated_id, :associated_type], 'associated_index'
fix_index_order_for [:auditable_id, :auditable_type], 'auditable_index'
Expand All @@ -14,7 +16,7 @@ def self.down
def fix_index_order_for(columns, index_name)
if index_exists? :audits, columns, name: index_name
remove_index :audits, name: index_name
add_index :audits, columns.reverse, name: index_name
add_index :audits, columns.reverse, name: index_name, algorithm: :concurrently
end
end
end