active_record_shards 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/active_record_shards/migration.rb +2 -1
- data/test/migrator_test.rb +6 -0
- data/test/test.log +4561 -0
- metadata +5 -3
@@ -44,7 +44,8 @@ module ActiveRecordShards
|
|
44
44
|
|
45
45
|
def migrate_with_forced_shard(direction)
|
46
46
|
if migration_shard.blank?
|
47
|
-
raise "Can't run migrations
|
47
|
+
raise "#{self.name}: Can't run migrations without a shard spec: this may be :all, :none,
|
48
|
+
or a specific shard (for data-fixups). please call shard(arg) in your migration."
|
48
49
|
end
|
49
50
|
|
50
51
|
shard = ActiveRecord::Base.current_shard_selection.shard
|
data/test/migrator_test.rb
CHANGED
@@ -58,6 +58,12 @@ class MigratorTest < ActiveSupport::TestCase
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_bad_migration
|
61
|
+
begin
|
62
|
+
CowardlyMigration.up
|
63
|
+
rescue Exception => e
|
64
|
+
assert_match /CowardlyMigration/, e.message
|
65
|
+
end
|
66
|
+
|
61
67
|
assert_raises(RuntimeError) do
|
62
68
|
CowardlyMigration.up
|
63
69
|
end
|