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
$connection
protected
Connection
$connection
$platform
protected
AbstractPlatform
$platform
$sm
protected
AbstractSchemaManager<string|int, AbstractPlatform>
$sm
$logger
private
LoggerInterface
$logger
$plannedSql
private
array<string|int, Query>
$plannedSql
= []
Methods
__construct()
public
__construct(Connection $connection, LoggerInterface $logger) : mixed
Parameters
- $connection : Connection
- $logger : LoggerInterface
abortIf()
public
abortIf(bool $condition[, string $message = 'Unknown Reason' ]) : void
Parameters
- $condition : bool
- $message : string = 'Unknown Reason'
Tags
down()
public
down(Schema $schema) : void
Parameters
- $schema : Schema
Tags
getDescription()
public
getDescription() : string
Return values
stringgetSql()
public
getSql() : array<string|int, Query>
Return values
array<string|int, Query>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
boolpostDown()
public
postDown(Schema $schema) : void
Parameters
- $schema : Schema
Tags
postUp()
public
postUp(Schema $schema) : void
Parameters
- $schema : Schema
Tags
preDown()
public
preDown(Schema $schema) : void
Parameters
- $schema : Schema
Tags
preUp()
public
preUp(Schema $schema) : void
Parameters
- $schema : Schema
Tags
skipIf()
public
skipIf(bool $condition[, string $message = 'Unknown Reason' ]) : void
Parameters
- $condition : bool
- $message : string = 'Unknown Reason'
Tags
up()
public
abstract up(Schema $schema) : void
Parameters
- $schema : Schema
Tags
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
write()
protected
write(string $message) : void
Parameters
- $message : string