All pages
Powered by GitBook
1 of 1

Creating Table Constraints

Sometimes you want to add constraints on a table level, rather than a column level. The following methods will let you accomplish that.

index

Create a generic index from one or more columns.

Example:

SchemaBuilder

SQL (MySQL)

foreignKey

Example:

SchemaBuilder

SQL (MySQL)

primaryKey

Create a primary key constraint from one or more columns.

Example:

SchemaBuilder

SQL (MySQL)

unique

Create a unique constraint from one or more columns.

Example:

SchemaBuilder

SQL (MySQL)