diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-03-16 12:36:28 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-03-16 12:36:28 +0000 |
commit | bfaf3d695553531a5b88747aa320371ba22ce641 (patch) | |
tree | cacdfb4269db9f3be4c0007b0a58735badf4e8c1 /lib | |
parent | 79aa00321063daf8f650683373db29832c8e13f1 (diff) | |
parent | 4acbc9410d2d3f5624ebf9cf8850b189524d321d (diff) | |
download | gitlab-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.rb | 4 |
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 |