所有的字段类型: | Option | Description | | --- | --- | | limit | set maximum length for strings, also hints column types in adapters (see note below) | | length | alias for `limit` | | default | set default value or action | | null | allow `NULL` values (should not be used with primary keys!) | | after | specify the column that a new column should be placed after | | comment | set a text comment on the column | For `decimal` columns: | Option | Description | | --- | --- | | precision | combine with `scale` set to set decimial accuracy | | scale | combine with `precision` to set decimial accuracy | For `enum` and `set` columns: | Option | Description | | --- | --- | | values | Can be a comma separated list or an array of values | For `integer` and `biginteger` columns: | Option | Description | | --- | --- | | identity | enable or disable automatic incrementing | | signed | enable or disable the `unsigned` option _(only applies to MySQL)_ | For `timestamp` columns: | Option | Description | | --- | --- | | default | set default value (use with `CURRENT_TIMESTAMP`) | | update | set an action to be triggered when the row is updated (use with `CURRENT_TIMESTAMP`) | | timezone | enable or disable the `with time zone` option for `time` and `timestamp` columns _(only applies to Postgres)_ | For foreign key definitions: | Option | Description | | --- | --- | | update | set an action to be triggered when the row is updated | | delete | set an action to be triggered when the row is deleted | You can pass one or more of these options to any column with the optional third argument array. ### Limit Option and MySQL When using the MySQL adapter, additional hinting of database column type can be made for `integer`and `text` columns. Using `limit` with one the following options will modify the column type accordingly: | Limit | Column Type | | --- | --- | | TEXT_TINY | TINYTEXT | | TEXT_REGULAR | TEXT | | TEXT_MEDIUM | MEDIUMTEXT | | TEXT_LONG | LONGTEXT | | INT_TINY | TINYINT | | INT_SMALL | SMALLINT | | INT_MEDIUM | MEDIUMINT | | INT_REGULAR | INT | | INT_BIG | BIGINT |