summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-03-16 12:36:28 +0000
committerRobert Speicher <rspeicher@gmail.com>2018-03-19 12:36:37 -0500
commit4cfe7682bdf50f41404d130a0e3e63389ed85809 (patch)
tree99ba6ebd87d7f2a3900012fc9903c6b5de225694 /lib
parentfb4eb55540a91ff86972909d8b1db95b9ad105e1 (diff)
downloadgitlab-ce-4cfe7682bdf50f41404d130a0e3e63389ed85809.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