Skip to content

Commit

Permalink
Merge pull request #145 from ifad/bugfix/fix-add-remove-column-w-opts…
Browse files Browse the repository at this point in the history
…-144

Allow options in remove_column migration
  • Loading branch information
tagliala authored Mar 19, 2022
2 parents a3d642e + 5ea3cbc commit 4fdb122
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/chrono_model/adapter/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def change_column_null(table_name, *)
# view, then drop the column from the table in the temporal schema and
# eventually recreate the triggers.
#
def remove_column(table_name, *)
def remove_column(table_name, column_name, type = nil, **options)
return super unless is_chrono?(table_name)
drop_and_recreate_public_view(table_name) { super }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/chrono_model/adapter/migrations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@

with_temporal_table do
before :all do
adapter.remove_column table, :foo
adapter.remove_column table, :foo, :integer, default: 0
end

it { is_expected.to have_columns(resulting_columns) }
Expand All @@ -346,7 +346,7 @@

with_plain_table do
before :all do
adapter.remove_column table, :foo
adapter.remove_column table, :foo, :integer, default: 0
end

it { is_expected.to have_columns(resulting_columns) }
Expand Down

0 comments on commit 4fdb122

Please sign in to comment.