Description
Since: 2.11.0-rc1
Root documents:
https://www.tarantool.io/en/doc/latest/book/box/data_model/#constraints
https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema/func_create/ (?)
https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/
Details
The Constraints and Foreign keys parts in the Data model section combine a high-level explanation and a how-to guide. However, the specific parameters are not mentioned there. It's also not the best place to describe individual parameters and how to use them.
So we need to update the reference, which has no mention of constraint parameters yet:
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema/func_create/#box-schema-func-create-with-body (?)
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/examples/
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/format/
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema/space_create/
Mention in the Data model > Constraints/Foreign keys sections that referring to self is also possible.
See also this detailed internal plan for restructuring Tarantool docs.
It is possible to create a foreign key that refers to the same space (a
child space equals to the parent space).
To do that, omit space
in the foreign_key
parameter, or set it to
the id or to the name of the current space.
Requested by @Gumix in tarantool/tarantool@f21f8e9.