Migration
Less than 1 minute
Migration
Represents a database migration, including events and metadata.
class Migration extends \Hazaar\DBI\Manager\StructEncapsulates migration message, requirements, execution steps, and up/down events for schema changes.
Properties
message
The message describing the migration.
public string $messageraise
Raises an exception if the migration is not compatible with the current database schema.
public string $raiserequires
List of migration versions that are required to be run before this migration.
public array $requiresexec
public array $execup
The event to run when applying the migration (up direction).
public Event $updown
The event to run when rolling back the migration (down direction).
public Event $downMethods
replay
Applies the migration by running the 'up' event.
public replay(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
rollback
Rolls back the migration by running the 'down' event.
public rollback(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000