Skip to content

apimigrationaddcolumn

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

addColumn()

Description

Adds a column to an existing table.

Function Syntax

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

Parameters

Parameter Type Required Default Description
table string Yes existing table name
columnType string Yes type of column to add (based on list of [data types](datatypes))
columnName string No name for new column, required if columnType is not 'reference'
referenceName string No name for new reference column, see documentation for [references](apitabledefinitionreferences) function, required if columnType is 'reference'
default string|integer No default value for the column, either a string or integer depending on the data type
null boolean No whether nulls are allowed
limit integer No character or integer size limit for column
precision integer No precision value for decimal columns, i.e. number of digits the column can hold
scale integer 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)

Examples

addColumn(table='members',columnType='string',columnName='status',limit=25);

addColumn(table='members',columnType='reference',referenceName='membertype');
Clone this wiki locally