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
tablestringyesThe Name of the table where the column is
columnNamestringyesTHe name of the column
columnTypestringyesThe type of the column
afterColumnstringnoThe name of the column which this column should be inserted after
referenceNamestringnoName for reference column, see documentation for references function, required if columnType is ‘reference’
defaultstringnoDefault value for this column
allowNullbooleannoWhether to allow NULL values
limitnumericnoCharacter 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