From 5e21f81ae95583498b39a521b4e0bb907b313c00 Mon Sep 17 00:00:00 2001
From: Jerry Cheung <jollyjerry@gmail.com>
Date: Fri, 1 Apr 2016 21:43:28 -0700
Subject: Prevent db:schema:load to protected environments

Follow up to https://github.com/rails/rails/pull/22967 to protect against
loading a schema on accident in production.

cc @schneems
---
 activerecord/lib/active_record/railties/databases.rake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'activerecord')

diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index 00cf8536e1..b1b169ae2f 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -256,7 +256,7 @@ db_namespace = namespace :db do
     end
 
     desc 'Loads a schema.rb file into the database'
-    task :load => [:environment, :load_config] do
+    task :load => [:environment, :load_config, :check_protected_environments] do
       ActiveRecord::Tasks::DatabaseTasks.load_schema_current(:ruby, ENV['SCHEMA'])
     end
 
-- 
cgit v1.2.3