generates column specification for ALTER or CREATE TABLE syntax
static public generateFieldSpec ( string $name, string $type, string $length = '', string $attribute = '', string $collation = '', boolean | string $null = false, string $default_type = 'USER_DEFINED', string $default_value = '', string $extra = '', string $comment = '', string $virtuality = '', string $expression = '', string $move_to = '' ) : string | ||
$name | string | name |
$type | string | type ('INT', 'VARCHAR', 'BIT', ...) |
$length | string | length ('2', '5,2', '', ...) |
$attribute | string | attribute |
$collation | string | collation |
$null | boolean | string | with 'NULL' or 'NOT NULL' |
$default_type | string | whether default is CURRENT_TIMESTAMP, NULL, NONE, USER_DEFINED |
$default_value | string | default value for USER_DEFINED default type |
$extra | string | 'AUTO_INCREMENT' |
$comment | string | field comment |
$virtuality | string | virtuality of the column |
$expression | string | expression for the virtual column |
$move_to | string | new position for column |
return | string | field specification |