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