Skip to content

apimigrationchangecolumn

Troy Murray edited this page Sep 19, 2011 · 2 revisions

changeColumn()

Description

Change a column definition for an existing column in a table.

Function Syntax

changeColumn(table,columnName,columnType[,referenceName,default,null,limit,precision,scale,addColumns]);

Parameters

Parameter Type Required Default Description
table string Yes Existing table name found in the database
columnName string Yes Existing column name to change
columnType string Yes New type for the column
referenceName string No Name for new reference column, required if columnType is 'reference'
default string No Default value for column
null boolean No Specifies if nulls are allowed in this column
limit integer No Character limit or integer size for column
precision integer No Used for decimal columns to specify the number of digits the column can hold
scale integer No number of digits that can be placed to the right of the decimal point
addColumns boolean No False If set to true, attempts to add columns and database will likely throw an error if column already exists

Examples

changeColumn(table='members',columnType='string',columnName='status',limit=50);
Clone this wiki locally