summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-03-16 12:36:28 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2018-03-16 12:36:28 +0000
commitbfaf3d695553531a5b88747aa320371ba22ce641 (patch)
treecacdfb4269db9f3be4c0007b0a58735badf4e8c1 /lib
parent79aa00321063daf8f650683373db29832c8e13f1 (diff)
parent4acbc9410d2d3f5624ebf9cf8850b189524d321d (diff)
downloadgitlab-ce-bfaf3d695553531a5b88747aa320371ba22ce641.tar.gz
Merge branch 'sh-cache-column-exists' into 'master'
Cache column_exists? for application settings See merge request gitlab-org/gitlab-ce!17780
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/database.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index e51794fef99..d4fc69cb173 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -183,6 +183,10 @@ module Gitlab
ActiveRecord::Base.connection
end
+ def self.cached_column_exists?(table_name, column_name)
+ connection.schema_cache.columns_hash(table_name).has_key?(column_name.to_s)
+ end
+
private_class_method :connection
def self.database_version