Skip to content

Commit d60a234

Browse files
committed
Revert "Don't silently execute statements on migrations when they can't be reversed"
This reverts commit 5b04d44. This is breaking more than it is fixing. We need to find a better way to handle this.
1 parent aaa8e9f commit d60a234

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

activerecord/CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
* Don't silently execute statements on migrations when they can't be reversed.
2-
3-
Fixes #51570.
4-
5-
*Rafael Mendonça França*
6-
71
* Allow `Sqlite3Adapter` to use `sqlite3` gem version `2.x`
82

93
*Mike Dalessio*

activerecord/lib/active_record/migration/command_recorder.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,9 @@ def respond_to_missing?(method, _)
376376
super || delegate.respond_to?(method)
377377
end
378378

379-
# Forwards any missing method call to the target.
379+
# Forwards any missing method call to the \target.
380380
def method_missing(method, ...)
381381
if delegate.respond_to?(method)
382-
record(method, ...)
383382
delegate.public_send(method, ...)
384383
else
385384
super

activerecord/test/cases/migration/command_recorder_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,12 @@ def test_inverse_of_raise_exception_on_unknown_commands
4646
assert_raises(ActiveRecord::IrreversibleMigration) do
4747
@recorder.inverse_of :execute, ["some sql"]
4848
end
49-
assert_raises(ActiveRecord::IrreversibleMigration) do
50-
@recorder.inverse_of :update, ["some sql"]
51-
end
5249
end
5350

5451
def test_irreversible_commands_raise_exception
5552
assert_raises(ActiveRecord::IrreversibleMigration) do
5653
@recorder.revert { @recorder.execute "some sql" }
5754
end
58-
assert_raises(ActiveRecord::IrreversibleMigration) do
59-
@recorder.revert { @recorder.update "some sql" }
60-
end
6155
end
6256

6357
def test_record

0 commit comments

Comments
 (0)