diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /app/models/pages_deployment.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'app/models/pages_deployment.rb')
-rw-r--r-- | app/models/pages_deployment.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/pages_deployment.rb b/app/models/pages_deployment.rb index 61818a63764..d67a92af6af 100644 --- a/app/models/pages_deployment.rb +++ b/app/models/pages_deployment.rb @@ -2,14 +2,18 @@ # PagesDeployment stores a zip archive containing GitLab Pages web-site class PagesDeployment < ApplicationRecord + include EachBatch include FileStoreMounter + MIGRATED_FILE_NAME = "_migrated.zip" + attribute :file_store, :integer, default: -> { ::Pages::DeploymentUploader.default_store } belongs_to :project, optional: false belongs_to :ci_build, class_name: 'Ci::Build', optional: true scope :older_than, -> (id) { where('id < ?', id) } + scope :migrated_from_legacy_storage, -> { where(file: MIGRATED_FILE_NAME) } validates :file, presence: true validates :file_store, presence: true, inclusion: { in: ObjectStorage::SUPPORTED_STORES } @@ -25,6 +29,10 @@ class PagesDeployment < ApplicationRecord # this is to be adressed in https://gitlab.com/groups/gitlab-org/-/epics/589 end + def migrated? + file.filename == MIGRATED_FILE_NAME + end + private def set_size |