2023-05-27 22:25:52 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ContainerRegistry
|
|
|
|
class DataRepairDetail < ApplicationRecord
|
2023-07-09 08:55:56 +05:30
|
|
|
include EachBatch
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
self.table_name = 'container_registry_data_repair_details'
|
|
|
|
self.primary_key = :project_id
|
|
|
|
|
|
|
|
belongs_to :project, optional: false
|
2023-07-09 08:55:56 +05:30
|
|
|
|
|
|
|
enum status: { ongoing: 0, completed: 1, failed: 2 }
|
|
|
|
|
|
|
|
scope :ongoing_since, ->(threshold) { where(status: :ongoing).where('updated_at < ?', threshold) }
|
2023-05-27 22:25:52 +05:30
|
|
|
end
|
|
|
|
end
|