| 
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 | # File 'lib/active_record_shards/migration.rb', line 92
def migrate_with_forced_shard(direction)
  if migration_shard.blank?
    raise "#{name}: Can't run migrations without a shard spec: this may be :all, :none,
             or a specific shard (for data-fixups).  please call shard(arg) in your migration."
  end
  shard = ActiveRecord::Base.current_shard_selection.shard
  if shard.nil?
    return if migration_shard != :none
  else
    return if migration_shard == :none
    return if migration_shard != :all && migration_shard.to_s != shard.to_s
  end
  migrate_without_forced_shard(direction)
end |