Skip to content

Instance Method

unique(_:named:)

Add a UNIQUE constraint to the table.
@discardableResult func unique(_ columns: String..., named constraintName: String? = nil) -> Self

Parameters

columns

One or more columns to include in the unique constraint.

constraintName

An optional name to give the constraint.