Skip to content

Commit

Permalink
Merge pull request #18413 from Fryguy/migration_patch_logging
Browse files Browse the repository at this point in the history
Add basic logging for the initial seeding of schema_migrations_ran
  • Loading branch information
bdunne authored Mar 8, 2019
2 parents ca1feb0 + 3b44041 commit 59b8dc4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/extensions/ar_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def self.update_local_migrations_ran(version, direction)
new_migrations = ActiveRecord::SchemaMigration.normalized_versions
new_migrations << version if direction == :up

(new_migrations - schema_migrations_ran_class.pluck(:version)).each do |v|
to_add = (new_migrations - schema_migrations_ran_class.pluck(:version))
puts "Seeding :schema_migrations_ran table..." if to_add.size > 1

to_add.each do |v|
schema_migrations_ran_class.find_or_create_by(:version => v)
end

Expand Down

0 comments on commit 59b8dc4

Please sign in to comment.