Skip to content

Migrator

changeColumn()

changeColumn() — returns void

Available in: migration Category: Migration Functions

changes a column definition Only available in a migration CFC

NameTypeRequiredDefaultDescription
tablestringyes—The Name of the table where the column is
columnNamestringyes—THe name of the column
columnTypestringyes—The type of the column
afterColumnstringno—The name of the column which this column should be inserted after
referenceNamestringno—Name for reference column, see documentation for references function, required if columnType is ‘reference’
defaultstringno—Default value for this column
nullbooleanno—Whether to allow NULL values
limitnumericno—Character or integer size limit for column
precisionnumericno—(For decimal type) the maximum number of digits allow
scalenumericno—(For decimal type) the number of digits to the right of the decimal point
addColumnsbooleannofalseif true, attempts to add columns and database will likely throw an error if column already exists
changeColumn(table='members', columnType='string', columnName='status', limit=50);