debian-mirror-gitlab/config/initializers/fill_shards.rb
2020-06-23 00:09:42 +05:30

7 lines
339 B
Ruby

# The explicit schema version check is needed because during our migration rollback testing,
# `Shard.connected?` could be cached and return true even though the table doesn't exist
return unless Shard.connected?
return unless ActiveRecord::Migrator.current_version >= 20190402150158
return if Gitlab::Database.read_only?
Shard.populate!