lib/generators/audited/upgrade_generator.rb in audited-4.5.0 vs lib/generators/audited/upgrade_generator.rb in audited-4.6.0

- old
+ new

@@ -23,10 +23,11 @@ private def migrations_to_be_applied Audited::Audit.reset_column_information columns = Audited::Audit.columns.map(&:name) + indexes = Audited::Audit.connection.indexes(Audited::Audit.table_name) yield :add_comment_to_audits unless columns.include?('comment') if columns.include?('changes') yield :rename_changes_to_audited_changes @@ -50,9 +51,13 @@ end end if columns.include?('association_id') yield :rename_association_to_associated + end + + if indexes.any? { |i| i.columns == %w[associated_id associated_type] } + yield :revert_polymorphic_indexes_order end end end end end