Skip to content
It's Vapor Week! Celebrating 10 Years of Vapor Read more

Instance Method

primaryKey(_:named:)

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

Parameters

columns

One or more columns to include in the primary key.

constraintName

An optional name to give the constraint.