Index
Less than 1 minute
Index
Represents a database index for migration actions.
class Index extends \Hazaar\DBI\Manager\Migration\Action\BaseActionEncapsulates index attributes such as name, table, columns, uniqueness, and index method. Provides methods for creating, altering, and dropping indexes in migration processes.
Properties
name
The name of the index.
public string $nametable
The name of the table the index applies to.
public string $tablecolumns
The columns included in the index.
public array $columnsunique
Whether the index is unique.
public bool $uniqueusing
The index method/algorithm (e.g., BTREE, HASH).
public string $usingMethods
create
Creates the index in the database.
public create(Adapter $dbi): boolValidates required properties and logs errors if missing.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
alter
Alters the index in the database.
public alter(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
drop
Drops the index from the database.
public drop(Adapter $dbi): boolIterates over the drop list and attempts to drop each index.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000