Skip to content

Commit e76f978

Browse files
authored
Merge pull request rails#46364 from rails/rm-no-migrations-in-test
Only ask people to run migration in a environment in non-development environments
2 parents b3c4eca + a1a91e2 commit e76f978

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/migration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def initialize(message = nil)
150150
private
151151
def detailed_migration_message
152152
message = "Migrations are pending. To resolve this issue, run:\n\n bin/rails db:migrate"
153-
message += " RAILS_ENV=#{::Rails.env}" if defined?(Rails.env)
153+
message += " RAILS_ENV=#{::Rails.env}" if defined?(Rails.env) && !(Rails.env.development? || Rails.env.test?)
154154
message += "\n\n"
155155

156156
pending_migrations = ActiveRecord::Base.connection.migration_context.open.pending_migrations

0 commit comments

Comments
 (0)