Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 06:08:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 06:08:02 +0300
commited73d4f207ef6cb8646719baa1188d096c9f3139 (patch)
treedea7ab9906154c73204a0361163e30500f929d44 /lib/gitlab/hashed_storage
parent2349eabc1a473bfb70555f0ce6d3d808cecb181d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/hashed_storage')
-rw-r--r--lib/gitlab/hashed_storage/rake_helper.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/gitlab/hashed_storage/rake_helper.rb b/lib/gitlab/hashed_storage/rake_helper.rb
index 14727b03ce9..7965f165683 100644
--- a/lib/gitlab/hashed_storage/rake_helper.rb
+++ b/lib/gitlab/hashed_storage/rake_helper.rb
@@ -47,23 +47,13 @@ module Gitlab
end
# rubocop: enable CodeReuse/ActiveRecord
- # rubocop: disable CodeReuse/ActiveRecord
def self.legacy_attachments_relation
- Upload.joins(<<~SQL).where('projects.storage_version < :version OR projects.storage_version IS NULL', version: Project::HASHED_STORAGE_FEATURES[:attachments])
- JOIN projects
- ON (uploads.model_type='Project' AND uploads.model_id=projects.id)
- SQL
+ Upload.inner_join_local_uploads_projects.merge(Project.without_storage_feature(:attachments))
end
- # rubocop: enable CodeReuse/ActiveRecord
- # rubocop: disable CodeReuse/ActiveRecord
def self.hashed_attachments_relation
- Upload.joins(<<~SQL).where('projects.storage_version >= :version', version: Project::HASHED_STORAGE_FEATURES[:attachments])
- JOIN projects
- ON (uploads.model_type='Project' AND uploads.model_id=projects.id)
- SQL
+ Upload.inner_join_local_uploads_projects.merge(Project.with_storage_feature(:attachments))
end
- # rubocop: enable CodeReuse/ActiveRecord
def self.relation_summary(relation_name, relation)
relation_count = relation.count