debian-mirror-gitlab/config/initializers/fill_shards.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
370 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2020-06-23 00:09:42 +05:30
# The explicit schema version check is needed because during our migration rollback testing,
2019-09-04 21:01:54 +05:30
# `Shard.connected?` could be cached and return true even though the table doesn't exist
2020-04-22 19:07:51 +05:30
return unless Shard.connected?
2020-06-23 00:09:42 +05:30
return unless ActiveRecord::Migrator.current_version >= 20190402150158
2020-04-22 19:07:51 +05:30
return if Gitlab::Database.read_only?
Shard.populate!