Commit f5a07dbb authored by dfrazao-gitlab's avatar dfrazao-gitlab

Support multiple databases for batched background migrations

- Change BatchedJobTransitionLog to use a SharedModel

Changelog: added

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/351585
parent 55bc8d11
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module Database module Database
module BackgroundMigration module BackgroundMigration
class BatchedJobTransitionLog < ApplicationRecord class BatchedJobTransitionLog < SharedModel
include PartitionedTable include PartitionedTable
self.table_name = :batched_background_migration_job_transition_logs self.table_name = :batched_background_migration_job_transition_logs
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Gitlab::Database::BackgroundMigration::BatchedJobTransitionLog, type: :model do RSpec.describe Gitlab::Database::BackgroundMigration::BatchedJobTransitionLog, type: :model do
it { is_expected.to be_a Gitlab::Database::SharedModel }
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:batched_job).with_foreign_key(:batched_background_migration_job_id) } it { is_expected.to belong_to(:batched_job).with_foreign_key(:batched_background_migration_job_id) }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment