diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 12fbb78c53e2e56f723b862fbdd5af654ccce9b6..76578978d5abbd8b29ae4e234b532621eef96840 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -59,7 +59,7 @@ module Gitlab
       # When the DBMS is not available, an exception (e.g. PG::ConnectionBad) is raised
       active_db_connection = ActiveRecord::Base.connection.active? rescue false
 
-      ENV['USE_DB'] != 'false' &&
+      ENV['SETUP_DB'] != 'false' &&
       active_db_connection &&
       ActiveRecord::Base.connection.table_exists?('application_settings')