An interface used by database TableSchema objects.
string
'biginteger' string
'binary' string
'binaryuuid' string
'boolean' string
'date' string
'datetime' string
'decimal' string
'float' string
'integer' string
'json' string
'smallinteger' string
'string' string
'text' string
'time' string
'timestamp' string
'tinyinteger' string
'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–2018 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.6/class-Cake.Database.Schema.TableSchemaInterface.html