Documentation

AbstractMigration
in package

AbstractYes

The AbstractMigration class is for end users to extend from when creating migrations. Extend this class and implement the required up() and down() methods.

Table of Contents

Properties

$connection  : Connection
$platform  : AbstractPlatform
$sm  : AbstractSchemaManager<string|int, AbstractPlatform>
$logger  : LoggerInterface
$plannedSql  : array<string|int, Query>

Methods

__construct()  : mixed
abortIf()  : void
down()  : void
getDescription()  : string
getSql()  : array<string|int, Query>
isTransactional()  : bool
Indicates the transactional mode of this migration.
postDown()  : void
postUp()  : void
preDown()  : void
preUp()  : void
skipIf()  : void
up()  : void
warnIf()  : void
addSql()  : void
throwIrreversibleMigrationException()  : void
write()  : void

Properties

Methods

abortIf()

public abortIf(bool $condition[, string $message = 'Unknown Reason' ]) : void
Parameters
$condition : bool
$message : string = 'Unknown Reason'
Tags
throws
AbortMigration

isTransactional()

Indicates the transactional mode of this migration.

public isTransactional() : bool

If this function returns true (default) the migration will be executed in one transaction, otherwise non-transactional state will be used to execute each of the migration SQLs.

Extending class should override this function to alter the return value.

Return values
bool

skipIf()

public skipIf(bool $condition[, string $message = 'Unknown Reason' ]) : void
Parameters
$condition : bool
$message : string = 'Unknown Reason'
Tags
throws
SkipMigration

warnIf()

public warnIf(bool $condition[, string $message = 'Unknown Reason' ]) : void
Parameters
$condition : bool
$message : string = 'Unknown Reason'

addSql()

protected addSql(string $sql[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $types = [] ]) : void
Parameters
$sql : string
$params : array<string|int, mixed> = []
$types : array<string|int, mixed> = []

throwIrreversibleMigrationException()

protected throwIrreversibleMigrationException([string|null $message = null ]) : void
Parameters
$message : string|null = null
Tags
throws
IrreversibleMigration

write()

protected write(string $message) : void
Parameters
$message : string

        
On this page

Search results