mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #21432 from yui-knk/fix/what_change_method_can_reverse
[ci skip] Update what methods `Migration#change` can reverse
This commit is contained in:
commit
13c6903451
2 changed files with 34 additions and 15 deletions
|
@ -5,10 +5,22 @@ module ActiveRecord
|
|||
# knows how to invert the following commands:
|
||||
#
|
||||
# * add_column
|
||||
# * add_foreign_key
|
||||
# * add_index
|
||||
# * add_reference
|
||||
# * add_timestamps
|
||||
# * create_table
|
||||
# * change_column_default (must supply a :from and :to option)
|
||||
# * change_column_null
|
||||
# * create_join_table
|
||||
# * create_table
|
||||
# * disable_extension
|
||||
# * drop_join_table
|
||||
# * drop_table (must supply a block)
|
||||
# * enable_extension
|
||||
# * remove_column (must supply a type)
|
||||
# * remove_foreign_key (must supply a second table)
|
||||
# * remove_index
|
||||
# * remove_reference
|
||||
# * remove_timestamps
|
||||
# * rename_column
|
||||
# * rename_index
|
||||
|
|
|
@ -522,20 +522,27 @@ majority of cases, where Active Record knows how to reverse the migration
|
|||
automatically. Currently, the `change` method supports only these migration
|
||||
definitions:
|
||||
|
||||
* `add_column`
|
||||
* `add_index`
|
||||
* `add_reference`
|
||||
* `add_timestamps`
|
||||
* `add_foreign_key`
|
||||
* `create_table`
|
||||
* `create_join_table`
|
||||
* `drop_table` (must supply a block)
|
||||
* `drop_join_table` (must supply a block)
|
||||
* `remove_timestamps`
|
||||
* `rename_column`
|
||||
* `rename_index`
|
||||
* `remove_reference`
|
||||
* `rename_table`
|
||||
* add_column
|
||||
* add_foreign_key
|
||||
* add_index
|
||||
* add_reference
|
||||
* add_timestamps
|
||||
* change_column_default (must supply a :from and :to option)
|
||||
* change_column_null
|
||||
* create_join_table
|
||||
* create_table
|
||||
* disable_extension
|
||||
* drop_join_table
|
||||
* drop_table (must supply a block)
|
||||
* enable_extension
|
||||
* remove_column (must supply a type)
|
||||
* remove_foreign_key (must supply a second table)
|
||||
* remove_index
|
||||
* remove_reference
|
||||
* remove_timestamps
|
||||
* rename_column
|
||||
* rename_index
|
||||
* rename_table
|
||||
|
||||
`change_table` is also reversible, as long as the block does not call `change`,
|
||||
`change_default` or `remove`.
|
||||
|
|
Loading…
Reference in a new issue