From 3b44041f6d49aa420ba1968cb4727423b8ad698e Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Wed, 30 Jan 2019 15:38:07 -0500 Subject: [PATCH] Add basic logging for the initial seeding of schema_migrations_ran --- lib/extensions/ar_migration.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/extensions/ar_migration.rb b/lib/extensions/ar_migration.rb index 4d71da6d228..0116e63987a 100644 --- a/lib/extensions/ar_migration.rb +++ b/lib/extensions/ar_migration.rb @@ -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