-
Notifications
You must be signed in to change notification settings - Fork 19
apimigrationaddcolumn
Troy Murray edited this page Sep 19, 2011
·
3 revisions
Adds a column to an existing table.
addColumn(table,columnType[,columnName,referenceName,default,null,limit,precision,scale]);
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) |
addColumn(table='members',columnType='string',columnName='status',limit=25);
addColumn(table='members',columnType='reference',referenceName='membertype');