2021-02-03 21:09:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-20 06:08:06 +00:00
|
|
|
# The explicit schema version check is needed because during our migration rollback testing,
|
2019-02-20 23:51:55 +00:00
|
|
|
# `Shard.connected?` could be cached and return true even though the table doesn't exist
|
2020-03-26 18:08:03 +00:00
|
|
|
return unless Shard.connected?
|
2020-05-20 06:08:06 +00:00
|
|
|
return unless ActiveRecord::Migrator.current_version >= 20190402150158
|
2021-07-29 15:09:48 +00:00
|
|
|
return if Gitlab::Database.main.read_only?
|
2020-03-26 18:08:03 +00:00
|
|
|
|
|
|
|
Shard.populate!
|