2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ProjectPagesMetadatum < ApplicationRecord
|
2021-03-11 19:13:27 +05:30
|
|
|
extend SuppressCompositePrimaryKeyWarning
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
include EachBatch
|
2022-05-07 20:08:51 +05:30
|
|
|
include IgnorableColumns
|
2021-03-08 18:12:59 +05:30
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
self.primary_key = :project_id
|
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
ignore_columns :artifacts_archive_id, remove_with: '15.0', remove_after: '2022-04-22'
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
belongs_to :project, inverse_of: :pages_metadatum
|
2021-01-03 14:25:43 +05:30
|
|
|
belongs_to :pages_deployment
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
scope :deployed, -> { where(deployed: true) }
|
2021-03-08 18:12:59 +05:30
|
|
|
scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) }
|
2021-03-11 19:13:27 +05:30
|
|
|
scope :with_project_route_and_deployment, -> { preload(:pages_deployment, project: [:namespace, :route]) }
|
2019-12-21 20:55:43 +05:30
|
|
|
end
|