Skip to content

Commit 86517b0

Browse files
jonathanhefnerNataliya Terskaya
andcommitted
Add *_check_constraint actions to Migrations guide [ci-skip]
Closes rails#45356. Co-authored-by: Nataliya Terskaya <[email protected]>
1 parent 20bc41a commit 86517b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

guides/source/active_record_migrations.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ The `change` method is the primary way of writing migrations. It works for the
606606
majority of cases in which Active Record knows how to reverse a migration's
607607
actions automatically. Below are some of the actions that `change` supports:
608608

609+
* [`add_check_constraint`][]
609610
* [`add_column`][]
610611
* [`add_foreign_key`][]
611612
* [`add_index`][]
@@ -621,6 +622,7 @@ actions automatically. Below are some of the actions that `change` supports:
621622
* [`drop_join_table`][]
622623
* [`drop_table`][] (must supply a block)
623624
* `enable_extension`
625+
* [`remove_check_constraint`][] (must supply a constraint expression)
624626
* [`remove_column`][] (must supply a type)
625627
* [`remove_foreign_key`][] (must supply a second table)
626628
* [`remove_index`][]
@@ -644,12 +646,14 @@ remove_column :posts, :slug, :string, null: false, default: ''
644646
If you're going to need to use any other methods, you should use `reversible`
645647
or write the `up` and `down` methods instead of using the `change` method.
646648

649+
[`add_check_constraint`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_check_constraint
647650
[`add_foreign_key`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_foreign_key
648651
[`add_timestamps`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_timestamps
649652
[`change_column_comment`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_column_comment
650653
[`change_table_comment`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_table_comment
651654
[`drop_join_table`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-drop_join_table
652655
[`drop_table`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-drop_table
656+
[`remove_check_constraint`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_check_constraint
653657
[`remove_foreign_key`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_foreign_key
654658
[`remove_index`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_index
655659
[`remove_reference`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_reference

0 commit comments

Comments
 (0)