Search⌘ K
AI Features

Column Type and Modifier Methods

Explore how to define database fields using column type and modifier methods in AdonisJs migrations. Understand how to set defaults, indexes, keys, and constraints to shape your database schema effectively.

We'll cover the following...

The following are some column type and modifier methods that are used to define the characteristics of individual field attributes in the up() method in the schema files:

Column type methods

Method Description
table.increments(name) Creates a column with auto-incrementing values.
table.bigInteger(name) Creates a BIGINT column.
table.decimal(name, [precision, scale])
...