-
Notifications
You must be signed in to change notification settings - Fork 22.2k
Closed
Description
Steps to reproduce
It's easy to make a mistake in a migration and accidentally use an option that ends up being ignored.
Some options are supported by one command but not another:
create_table :things do |t|
# Good - Creates column_a and an index
t.integer :column_a, index: true
end
# Bad - Creates column_b but silently ignores the index option
add_column :things, :column_b, :integer, index: trueAnd typos are allowed. In this example from Stack Overflow, using precison instead of precision still created a numeric column without the precision defined.
Expected behavior
Migrations should raise an exception for unsupported options.
Actual behavior
Migration completes successfully without any error.
System configuration
Rails version: 6.0
Ruby version: 2.6
Reactions are currently unavailable