2022-04-04 11:22:00 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Database
|
|
|
|
module BackgroundMigration
|
2022-05-07 20:08:51 +05:30
|
|
|
class BatchedJobTransitionLog < SharedModel
|
2022-04-04 11:22:00 +05:30
|
|
|
include PartitionedTable
|
|
|
|
|
|
|
|
self.table_name = :batched_background_migration_job_transition_logs
|
|
|
|
|
|
|
|
self.primary_key = :id
|
|
|
|
|
|
|
|
partitioned_by :created_at, strategy: :monthly, retain_for: 6.months
|
|
|
|
|
|
|
|
belongs_to :batched_job, foreign_key: :batched_background_migration_job_id
|
|
|
|
|
|
|
|
validates :previous_status, :next_status, :batched_job, presence: true
|
|
|
|
|
|
|
|
validates :exception_class, length: { maximum: 100 }
|
|
|
|
validates :exception_message, length: { maximum: 1000 }
|
|
|
|
|
|
|
|
enum previous_status: Gitlab::Database::BackgroundMigration::BatchedJob.state_machine.states.map(&:name), _prefix: true
|
|
|
|
enum next_status: Gitlab::Database::BackgroundMigration::BatchedJob.state_machine.states.map(&:name), _prefix: true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|