diff options
| author | Gabriel Mazetto <brodock@gmail.com> | 2017-11-18 07:26:07 +0100 |
|---|---|---|
| committer | Gabriel Mazetto <brodock@gmail.com> | 2017-11-23 14:19:36 +0100 |
| commit | d0a08ab888db33437c7df4eb37b5805757a6dce4 (patch) | |
| tree | 6476717de51a73d197aceab992e4718b0f6dcffe /app/models/project.rb | |
| parent | 4af26c1c65e4cc1d18a37acbc2af6ae29e91b336 (diff) | |
| download | gitlab-ce-d0a08ab888db33437c7df4eb37b5805757a6dce4.tar.gz | |
Improve storage migration rake task
Diffstat (limited to 'app/models/project.rb')
| -rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 894ded2a9f6..f20c0688bc2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -272,8 +272,9 @@ class Project < ActiveRecord::Base scope :pending_delete, -> { where(pending_delete: true) } scope :without_deleted, -> { where(pending_delete: false) } - scope :with_hashed_storage, -> { where('storage_version >= 1') } - scope :with_legacy_storage, -> { where(storage_version: [nil, 0]) } + scope :with_storage_feature, ->(feature) { where('storage_version >= :version', version: HASHED_STORAGE_FEATURES[feature]) } + scope :without_storage_feature, ->(feature) { where('storage_version < :version OR storage_version IS NULL', version: HASHED_STORAGE_FEATURES[feature]) } + scope :with_unmigrated_storage, -> { where('storage_version < :version OR storage_version IS NULL', version: LATEST_STORAGE_VERSION) } scope :sorted_by_activity, -> { reorder(last_activity_at: :desc) } scope :sorted_by_stars, -> { reorder('projects.star_count DESC') } |
