mirror of https://github.com/rails/rails
Merge pull request #52004 from duffuniverse/fix-typo-in-active-record-and-postgresql-guide
[ci skip] Fix a typo in Active Record and PostgreSQL guide
This commit is contained in:
commit
40a52362af
|
@ -615,7 +615,7 @@ Deferrable Foreign Keys
|
|||
|
||||
* [foreign key table constraints](https://www.postgresql.org/docs/current/sql-set-constraints.html)
|
||||
|
||||
By default, table constraints in PostgreSQL are checked immediately after each statement. It intentionally does not allow creating records where the referenced record is not yet in the referenced table. It is possible to run this integrity check later on when the transactions is committed by adding `DEFERRABLE` to the foreign key definition though. To defer all checks by default it can be set to `DEFERRABLE INITIALLY DEFERRED`. Rails exposes this PostgreSQL feature by adding the `:deferrable` key to the `foreign_key` options in the `add_reference` and `add_foreign_key` methods.
|
||||
By default, table constraints in PostgreSQL are checked immediately after each statement. It intentionally does not allow creating records where the referenced record is not yet in the referenced table. It is possible to run this integrity check later on when the transaction is committed by adding `DEFERRABLE` to the foreign key definition though. To defer all checks by default it can be set to `DEFERRABLE INITIALLY DEFERRED`. Rails exposes this PostgreSQL feature by adding the `:deferrable` key to the `foreign_key` options in the `add_reference` and `add_foreign_key` methods.
|
||||
|
||||
One example of this is creating circular dependencies in a transaction even if you have created foreign keys:
|
||||
|
||||
|
|
Loading…
Reference in New Issue