Return to v2.1 docs

addColumn()


Migrator Migration Functions void migration


adds a column to existing table Only available in a migration CFC

Name Type Required Default Description
table string Yes The Name of the table to add the column to
columnType string Yes The type of the new column
columnName string Yes THe name of the new column
afterColumn string No The name of the column which this column should be inserted after
referenceName string No Name for new reference column, see documentation for references function, required if columnType is 'reference'
default string No Default value for this column
null boolean No Whether to allow NULL values
limit numeric No Character or integer size limit for column
precision numeric No precision value for decimal columns, i.e. number of digits the column can hold
scale numeric No scale value for decimal columns, i.e. number of digits that can be placed to the right of the decimal point (must be less than or equal to precision)
addColumn(table='members', columnType='string', columnName='status', limit=50);

Related Functions

Migration Functions