Skip to content

Migrator

change()

change() — returns void

Available in: tabledefinition Category: Table Definition Functions

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.

NameTypeRequiredDefaultDescription
addColumnsbooleannofalse
1. Alter a table to add new columns
t = changeTable(name='employees');
t.string(columnNames="fullName", default="", allowNull=true, limit="255");
t.change();