An interface used by database TableSchema objects.
string
TYPE_BIGINTEGER
'biginteger'
string
TYPE_BINARY
'binary'
string
TYPE_BINARY_UUID
'binaryuuid'
string
TYPE_BOOLEAN
'boolean'
string
TYPE_DATE
'date'
string
TYPE_DATETIME
'datetime'
string
TYPE_DECIMAL
'decimal'
string
TYPE_FLOAT
'float'
string
TYPE_INTEGER
'integer'
string
TYPE_JSON
'json'
string
TYPE_SMALLINTEGER
'smallinteger'
string
TYPE_STRING
'string'
string
TYPE_TEXT
'text'
string
TYPE_TIME
'time'
string
TYPE_TIMESTAMP
'timestamp'
string
TYPE_TINYINTEGER
'tinyinteger'
string
TYPE_UUID
'uuid'
addConstraint( string $name , array $attrs )
Add a constraint.
Used to add constraints to a table. For example primary keys, unique keys and foreign keys.
type
The type of constraint being added.columns
The columns in the index.references
The table, column a foreign key references.update
The behavior on update. Options are 'restrict', 'setNull', 'cascade', 'noAction'.delete
The behavior on delete. Options are 'restrict', 'setNull', 'cascade', 'noAction'.The default for 'update' & 'delete' is 'cascade'.
$name
$attrs
addIndex( string $name , array $attrs )
Add an index.
Used to add indexes, and full text indexes in platforms that support them.
type
The type of index being added.columns
The columns in the index.$name
$attrs
constraints( )
Get the names of all the constraints in the table.
dropConstraint( string $name )
Remove a constraint.
$name
getConstraint( string $name )
Read information about a constraint based on name.
$name
getIndex( string $name )
Read information about an index based on name.
$name
hasAutoincrement( )
Check whether or not a table has an autoIncrement column defined.
isTemporary( )
Gets whether the table is temporary in the database.
primaryKey( )
Get the column(s) used for the primary key.
Column name(s) for the primary key. An empty list will be returned when the table has no primary key.
setTemporary( boolean $temporary )
Sets whether the table is temporary in the database.
$temporary
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.8/class-Cake.Database.Schema.TableSchemaInterface.html