ForeignKeyDefinition class final
A foreign key constraint.
Constructors
-
ForeignKeyDefinition(List<
String> columns, {String? name}) -
A foreign key on
columns; created by Blueprint.foreign and ForeignIdDefinition.constrained.
Properties
-
columns
→ List<
String> -
The local columns of the key.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- onDeleteAction ↔ String?
-
The
ON DELETEaction (onDelete), upper case.getter/setter pair - onUpdateAction ↔ String?
-
The
ON UPDATEaction (onUpdate), upper case.getter/setter pair -
referencedColumns
↔ List<
String> -
The columns it references in referencedTable (
idby default).getter/setter pair - referencedTable ↔ String?
-
The table it references (on).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cascadeOnDelete(
) → ForeignKeyDefinition - Deletes the rows when the referenced row is deleted.
-
cascadeOnUpdate(
) → ForeignKeyDefinition - Updates the column when the referenced key changes.
-
nameFor(
String table) → String -
Constraint name (
<table>_<columns>_foreignwhen unset). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
nullOnDelete(
) → ForeignKeyDefinition -
Sets the column to
NULLwhen the referenced row is deleted. -
on(
String table) → ForeignKeyDefinition -
The referenced table (
->on('users')). -
onDelete(
String action) → ForeignKeyDefinition -
The action when the referenced row is deleted:
cascade,restrict,set nullorno action. -
onUpdate(
String action) → ForeignKeyDefinition - The action when the referenced key changes.
-
references(
Object column) → ForeignKeyDefinition -
The referenced column, or a list of columns (
->references('id')). -
restrictOnDelete(
) → ForeignKeyDefinition - Refuses to delete a referenced row while rows point at it.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited