Migrator
primaryKey()
Signature
Section titled “Signature”primaryKey() — returns any
Available in: tabledefinition
Category: Table Definition Functions
Description
Section titled “Description”Adds a primary key definition to the table. this method also allows for multiple primary keys.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | — | |
type | string | no | integer | |
autoIncrement | boolean | no | false | |
limit | numeric | no | — | |
precision | numeric | no | — | |
scale | numeric | no | — | |
references | string | no | — | |
onUpdate | string | no | — | |
onDelete | string | no | — |