Migrator
change()
Signature
Section titled “Signature”change() — returns void
Available in: tabledefinition
Category: Table Definition Functions
Description
Section titled “Description”Used in migrations to alter an existing table in the database. This function allows you to modify the structure of a table, such as adding, modifying, or removing columns.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
addColumns | boolean | no | false |
Examples
Section titled “Examples”1. Alter a table to add new columns
t = changeTable(name='employees');
t.string(columnNames="fullName", default="", allowNull=true, limit="255");
t.change();