Skip to content

Commit 2e8f4cb

Browse files
authored
Merge pull request rails#45669 from adrianna-chang-shopify/ac-allow-change-table-to-specify-base
Allow base for `Table` schema definition to be injected into `#change_table`
2 parents 1a6cca6 + 1f77762 commit 2e8f4cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,13 @@ def drop_join_table(table_1, table_2, **options)
474474
# end
475475
#
476476
# See also Table for details on all of the various column transformations.
477-
def change_table(table_name, **options)
477+
def change_table(table_name, base = self, **options)
478478
if supports_bulk_alter? && options[:bulk]
479479
recorder = ActiveRecord::Migration::CommandRecorder.new(self)
480480
yield update_table_definition(table_name, recorder)
481481
bulk_change_table(table_name, recorder.commands)
482482
else
483-
yield update_table_definition(table_name, self)
483+
yield update_table_definition(table_name, base)
484484
end
485485
end
486486

0 commit comments

Comments
 (0)