class Configuration extends Configuration (View source)

Constants

FORCEDMIGRATION_INCLUSIVE

Forced initial migration: inclusive.

FORCEDMIGRATION_EXCLUSIVE

Forced initial migration: exclusive.

Properties

protected null|Version $forcedInitialMigration Forced initial migration.

Methods

__construct(bool $registerMigrations = true)

Construct a migration configuration object.

forceMaxInitialMigration()

Force the initial migration to be the least recent repeatable one.

forceInitialMigration(string $reference, string $criteria = self::FORCEDMIGRATION_INCLUSIVE)

Force the initial migration, using a specific point.

Version|null
getForcedInitialMigration()

Get the forced initial migration (if set).

resetForceInitialMigration()

Reset the forced initial migration.

registerPreviousMigratedVersions()

This is a stupid requirement, but basically, we grab the lowest version number in our system database migrations table, and we loop through all migrations in our file system and for any of those LOWER than the lowest one in the table, we can assume they are included in this migration. We then manually insert these rows into the SystemDatabaseMigrations table so Doctrine isn't stupid and attempt to apply them.

getMigrationsToExecute($direction, $to)

{@inheritdoc}

Version|null
findInitialMigration(string $reference, string $criteria)

Get the initial migration given a reference (in form YYYYMMDDhhmmss or as a core version).

Version|null
findInitialMigrationByIdentifier(string $identifier, string $criteria)

Get the initial migration starting from its identifier (in form YYYYMMDDhhmmss).

Version|null
findInitialMigrationByCoreVersion(string $coreVersion, string $criteria)

Get the initial migration starting from a core version.

Details

__construct(bool $registerMigrations = true)

Construct a migration configuration object.

Parameters

bool $registerMigrations set to true to load the currently available migrations

forceMaxInitialMigration()

Force the initial migration to be the least recent repeatable one.

forceInitialMigration(string $reference, string $criteria = self::FORCEDMIGRATION_INCLUSIVE)

Force the initial migration, using a specific point.

Parameters

string $reference A concrete5 version (eg. '8.3.1') or a migration identifier (eg '20171218000000')
string $criteria One of the FORCEDMIGRATION_... constants

Version|null getForcedInitialMigration()

Get the forced initial migration (if set).

Return Value

Version|null

resetForceInitialMigration()

Reset the forced initial migration.

registerPreviousMigratedVersions()

This is a stupid requirement, but basically, we grab the lowest version number in our system database migrations table, and we loop through all migrations in our file system and for any of those LOWER than the lowest one in the table, we can assume they are included in this migration. We then manually insert these rows into the SystemDatabaseMigrations table so Doctrine isn't stupid and attempt to apply them.

getMigrationsToExecute($direction, $to)

{@inheritdoc}

Parameters

$direction
$to

See also

\Doctrine\DBAL\Migrations\Configuration\Configuration::getMigrationsToExecute()

protected Version|null findInitialMigration(string $reference, string $criteria)

Get the initial migration given a reference (in form YYYYMMDDhhmmss or as a core version).

Parameters

string $reference The migration reference
string $criteria One of the FORCEDMIGRATION_... constants

Return Value

Version|null

Exceptions

Exception throws an Exception if $criteria is not valid

protected Version|null findInitialMigrationByIdentifier(string $identifier, string $criteria)

Get the initial migration starting from its identifier (in form YYYYMMDDhhmmss).

Parameters

string $identifier The migration identifier
string $criteria One of the FORCEDMIGRATION_... constants

Return Value

Version|null

Exceptions

Exception throws an Exception if $criteria is not valid

protected Version|null findInitialMigrationByCoreVersion(string $coreVersion, string $criteria)

Get the initial migration starting from a core version.

Parameters

string $coreVersion The core version
string $criteria One of the FORCEDMIGRATION_... constants

Return Value

Version|null

Exceptions

Exception throws an Exception if $criteria is not valid