Skip to content

Commit

Permalink
Merge pull request #44928 from gumatias/patch-1
Browse files Browse the repository at this point in the history
Add missing info for `change` column and table comment in Guides [ci-skip]

(cherry picked from commit bc9fa03)
  • Loading branch information
jonathanhefner committed Apr 29, 2022
1 parent 777e0e0 commit 05e1f70
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions guides/source/active_record_migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,17 +603,18 @@ and
### Using the `change` Method

The `change` method is the primary way of writing migrations. It works for the
majority of cases, where Active Record knows how to reverse the migration
automatically. Currently, the `change` method supports only these migration
definitions:
majority of cases in which Active Record knows how to reverse a migration's
actions automatically. Below are some of the actions that `change` supports:

* [`add_column`][]
* [`add_foreign_key`][]
* [`add_index`][]
* [`add_reference`][]
* [`add_timestamps`][]
* [`change_column_comment`][] (must supply a `:from` and `:to` option)
* [`change_column_default`][] (must supply a `:from` and `:to` option)
* [`change_column_null`][]
* [`change_table_comment`][] (must supply a `:from` and `:to` option)
* [`create_join_table`][]
* [`create_table`][]
* `disable_extension`
Expand Down Expand Up @@ -645,6 +646,8 @@ or write the `up` and `down` methods instead of using the `change` method.

[`add_foreign_key`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_foreign_key
[`add_timestamps`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_timestamps
[`change_column_comment`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_column_comment
[`change_table_comment`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_table_comment
[`drop_join_table`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-drop_join_table
[`drop_table`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-drop_table
[`remove_foreign_key`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_foreign_key
Expand Down

0 comments on commit 05e1f70

Please sign in to comment.