Skip to content

Type Method

references(_:_:onDelete:onUpdate:)

Specifies a FOREIGN KEY constraint by individual parameters.
static func references(_ table: String, _ column: String, onDelete: SQLForeignKeyAction? = nil, onUpdate: SQLForeignKeyAction? = nil) -> SQLColumnConstraintAlgorithm

Parameters

table

The table to reference with the foreign key.

column

A column in the referenced table to refer to.

onDelete

Desired behavior when the row referenced by the key is deleted (default unspecified).

onUpdate

Desired behavior when the row referenced by the key is updated (default unspecified).

Return Value

A configured SQLColumnConstraintAlgorithm.