Skip to content

Commit a89412b

Browse files
Remove redundant caveat for remove_column [ci-skip]
1 parent 8d0748e commit a89412b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

guides/source/active_record_migrations.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ actions automatically. Below are some of the actions that `change` supports:
696696
* [`drop_table`][] (must supply a block)
697697
* `enable_extension`
698698
* [`remove_check_constraint`][] (must supply a constraint expression)
699-
* [`remove_column`][] (must supply a type)
700-
* [`remove_columns`][] (must supply a `:type` option)
699+
* [`remove_column`][] (must supply original type and column options)
700+
* [`remove_columns`][] (must supply original type and column options)
701701
* [`remove_foreign_key`][] (must supply a second table)
702702
* [`remove_index`][]
703703
* [`remove_reference`][]
@@ -709,14 +709,6 @@ actions automatically. Below are some of the actions that `change` supports:
709709
[`change_table`][] is also reversible, as long as the block only calls
710710
reversible operations like the ones listed above.
711711

712-
`remove_column` is reversible if you supply the column type as the third
713-
argument. Provide the original column options too, otherwise Rails can't
714-
recreate the column exactly when rolling back:
715-
716-
```ruby
717-
remove_column :posts, :slug, :string, null: false, default: ''
718-
```
719-
720712
If you're going to need to use any other methods, you should use `reversible`
721713
or write the `up` and `down` methods instead of using the `change` method.
722714

0 commit comments

Comments
 (0)