2019-09-25 05:06:04 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ProjectPagesMetadatum < ApplicationRecord
|
2021-01-27 07:09:01 -05:00
|
|
|
extend SuppressCompositePrimaryKeyWarning
|
|
|
|
|
2020-12-23 01:10:22 -05:00
|
|
|
include EachBatch
|
2022-02-21 19:14:20 -05:00
|
|
|
include IgnorableColumns
|
2020-12-23 01:10:22 -05:00
|
|
|
|
2019-09-25 05:06:04 -04:00
|
|
|
self.primary_key = :project_id
|
|
|
|
|
2022-02-21 19:14:20 -05:00
|
|
|
ignore_columns :artifacts_archive_id, remove_with: '15.0', remove_after: '2022-04-22'
|
|
|
|
|
2019-09-25 05:06:04 -04:00
|
|
|
belongs_to :project, inverse_of: :pages_metadatum
|
2020-10-12 14:08:31 -04:00
|
|
|
belongs_to :pages_deployment
|
2019-09-25 05:06:04 -04:00
|
|
|
|
|
|
|
scope :deployed, -> { where(deployed: true) }
|
2020-12-23 01:10:22 -05:00
|
|
|
scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) }
|
2021-01-26 10:08:58 -05:00
|
|
|
scope :with_project_route_and_deployment, -> { preload(:pages_deployment, project: [:namespace, :route]) }
|
2019-09-25 05:06:04 -04:00
|
|
|
end
|