Skip to content

Commit

Permalink
Merge pull request #45669 from adrianna-chang-shopify/ac-allow-change…
Browse files Browse the repository at this point in the history
…-table-to-specify-base

Allow base for `Table` schema definition to be injected into `#change_table`
  • Loading branch information
eileencodes committed Jul 27, 2022
2 parents 1a6cca6 + 1f77762 commit 2e8f4cb
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -474,13 +474,13 @@ def drop_join_table(table_1, table_2, **options)
# end
#
# See also Table for details on all of the various column transformations.
def change_table(table_name, **options)
def change_table(table_name, base = self, **options)
if supports_bulk_alter? && options[:bulk]
recorder = ActiveRecord::Migration::CommandRecorder.new(self)
yield update_table_definition(table_name, recorder)
bulk_change_table(table_name, recorder.commands)
else
yield update_table_definition(table_name, self)
yield update_table_definition(table_name, base)
end
end

Expand Down

0 comments on commit 2e8f4cb

Please sign in to comment.