name()
name() : string
Get the name of the table.
An interface used by TableSchema objects.
addColumn(string $name, array|string $attrs) : $this
Add a column to the table.
Columns can have several attributes:
type
The type of the column. This should be
one of CakePHP's abstract types.length
The length of the column.precision
The number of decimal places to store
for float and decimal types.default
The default value of the column.null
Whether or not the column can hold nulls.fixed
Whether or not the column is a fixed length column.
This is only present/valid with string columns.unsigned
Whether or not the column is an unsigned column.
This is only present/valid for integer, decimal, float columns.In addition to the above keys, the following keys are implemented in some database dialects, but not all:
comment
The comment for the column.string | $name | The name of the column |
array|string | $attrs | The attributes for the column. |
Loading…