ForeignKeyConstraint¶
- pydantic model felis.datamodel.ForeignKeyConstraint¶
Table foreign key constraint model.
This constraint is used to define a foreign key relationship between two tables in the schema. There must be at least one column in the
columns
list, and at least one column in thereferenced_columns
list or a validation error will be raised.Notes
These relationships will be reflected in the TAP_SCHEMA
keys
andkey_columns
data.- Parameters:
data (
Any
)- Fields:
- Validators:
check_column_lengths
»all fields
- field columns: list[str] [Required]¶
The columns comprising the foreign key.
- Constraints:
min_length = 1
- Validated by:
- field on_delete: Literal['CASCADE', 'SET NULL', 'SET DEFAULT', 'RESTRICT', 'NO ACTION'] | None = None¶
Action to take when the referenced row is deleted.
- Validated by:
- field on_update: Literal['CASCADE', 'SET NULL', 'SET DEFAULT', 'RESTRICT', 'NO ACTION'] | None = None¶
Action to take when the referenced row is updated.
- Validated by:
- field referenced_columns: list[str] [Required] (alias 'referencedColumns')¶
The columns referenced by the foreign key.
- Constraints:
min_length = 1
- Validated by:
- field type: Literal['ForeignKey'] = 'ForeignKey' (alias '@type')¶
Type of the constraint.
- Validated by:
- validator check_column_lengths » all fields¶
Check that the
columns
andreferenced_columns
lists have the same length.- Returns:
The foreign key constraint being validated.
- Return type:
- Raises:
ValueError – Raised if the
columns
andreferenced_columns
lists do not have the same length.