Column name(s) for the primary key. An * empty list will be returned when the table has no primary key. */ public function getPrimaryKey(): array; /** * Add an index. * * Used to add indexes, and full text indexes in platforms that support * them. * * ### Attributes * * - `type` The type of index being added. * - `columns` The columns in the index. * * @param string $name The name of the index. * @param array|string $attrs The attributes for the index. * If string it will be used as `type`. * @return $this * @throws \Cake\Database\Exception\DatabaseException */ public function addIndex(string $name, $attrs); /** * Read information about an index based on name. * * @param string $name The name of the index. * @return array|null Array of index data, or null */ public function getIndex(string $name): ?array; /** * Get the names of all the indexes in the table. * * @return array */ public function indexes(): array; /** * Add a constraint. * * Used to add constraints to a table. For example primary keys, unique * keys and foreign keys. * * ### Attributes * * - `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'. * * @param string $name The name of the constraint. * @param array|string $attrs The attributes for the constraint. * If string it will be used as `type`. * @return $this * @throws \Cake\Database\Exception\DatabaseException */ public function addConstraint(string $name, $attrs); /** * Read information about a constraint based on name. * * @param string $name The name of the constraint. * @return array|null Array of constraint data, or null */ public function getConstraint(string $name): ?array; /** * Remove a constraint. * * @param string $name Name of the constraint to remove * @return $this */ public function dropConstraint(string $name); /** * Get the names of all the constraints in the table. * * @return array */ public function constraints(): array; }