Column
Column
Represents a database column component for migration actions.
class Column extends \Hazaar\DBI\Manager\Migration\Action\Component\BaseComponentExtends: Hazaar\DBI\Manager\Migration\Action\Component\BaseComponent
Encapsulates column attributes such as name, type, default value, nullability, and primary key status.
Properties
name
The name of the column.
public string $nameType: string
default
The default value for the column.
public mixed $defaultType: mixed
not_null
Whether the column is NOT NULL.
public bool $not_nullType: bool
type
The data type of the column.
public string $typeType: string
length
The type length/precision (e.g. the 255 in varchar(255)).
public string $lengthType: string
using
A USING expression for an ALTER COLUMN TYPE change, when the new type can't be reached by
public string $usingType: string
an implicit cast (e.g. casting a text column onto a custom enum type sharing its values).
primarykey
Whether the column is a primary key.
public bool $primarykeyType: bool
Methods
changed
Determines if the column has changed compared to another column instance.
public changed(BaseComponent $column): ?BaseComponentReturns: Hazaar\DBI\Manager\Migration\Action\Component\BaseComponent
Compares all properties of the column and returns this instance if any property differs.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | Hazaar\DBI\Manager\Migration\Action\Component\BaseComponent | the column to compare against |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000