-
Notifications
You must be signed in to change notification settings - Fork 18
apitabledefinitioncolumn
Troy Murray edited this page Sep 19, 2011
·
2 revisions
Adds a column definition to the table definition object
t.column(columnName,columnType[,default,null,limit,precision,scale]);| Parameter | Type | Required | Default | Description |
| columnName | string | Yes | name of column | |
| columnType | string | Yes | type of column, allowed types include primaryKey, [binary](apitabledefinitionbinary), [boolean](apitabledefinitionboolean), [date](apitabledefinitiondate), [datetime](apitabledefinitiondatetime), [decimal](apitabledefinitiondecimal), [float](apitabledefinitionfloat.md), [integer](apitabledefinitioninteger), [string](apitabledefinitionstring), [text](apitabledefinitiontext), [time](apitabledefinitiontime), [timestamp](apitabledefinitiontimestamp) | |
| 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) |
You will probably rarely use this function directly, instead you will probably want to make use of the different alias functions for different data types (eg. string, text, integer etc.).