Skip to content

Commit

Permalink
Improve error message for removing a column
Browse files Browse the repository at this point in the history
  • Loading branch information
fatkodima committed Oct 19, 2024
1 parent f5e0423 commit 630c78f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/online_migrations/error_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def change

remove_column:
"<% if !small_table && indexes.any? %>
Removing a column will automatically remove all of the indexes that involved the removed column.
But the indexes would be removed non-concurrently, so you need to safely remove the indexes first:
Removing a column will automatically remove all the indexes that include this column.
Indexes will be removed non-concurrently, so you need to safely remove them first:
class <%= migration_name %>RemoveIndexes < <%= migration_parent %>
disable_ddl_transaction!
Expand Down
4 changes: 2 additions & 2 deletions test/command_checker/removing_columns_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def change

def test_remove_column_with_index
assert_unsafe RemoveColumnWithIndex, <<~MSG
Removing a column will automatically remove all of the indexes that involved the removed column.
But the indexes would be removed non-concurrently, so you need to safely remove the indexes first:
Removing a column will automatically remove all the indexes that include this column.
Indexes will be removed non-concurrently, so you need to safely remove them first:
class CommandChecker::RemovingColumnsTest::RemoveColumnWithIndexRemoveIndexes < #{migration_parent}
disable_ddl_transaction!
Expand Down

0 comments on commit 630c78f

Please sign in to comment.