Méthode | Description | |
---|---|---|
__construct ( Doctrine\DBAL\Connection $connection, Doctrine\DBAL\Migrations\OutputWriter $outputWriter = null, Doctrine\DBAL\Migrations\Finder\MigrationFinderInterface $finder = null ) | Construct a migration configuration object. | |
areMigrationsOrganizedByYear ( ) : boolean | ||
areMigrationsOrganizedByYearAndMonth ( ) : boolean | ||
createMigrationTable ( ) : boolean | Create the migration table to track migrations with. | |
formatVersion ( string $version ) : string | Returns a timestamp version as a formatted date | |
generateVersionNumber ( DateTimeInterface $now = null ) : string | Generate a new migration version. A version is (usually) a datetime string. | |
getAvailableVersions ( ) : array | Returns an array of available migration version numbers. | |
getConnection ( ) : Doctrine\DBAL\Connection | Returns the Connection instance | |
getCurrentVersion ( ) : string | Returns the current migrated version from the versions table. | |
getDateTime ( $version ) : string | Returns the datetime of a migration | |
getLatestVersion ( ) : string | Returns the latest available migration version. | |
getMigratedVersions ( ) : |
Returns all migrated versions from the versions table, in an array. | |
getMigrations ( ) : |
Get the array of registered migration versions. | |
getMigrationsColumnName ( ) : string | Returns the migration column name | |
getMigrationsDirectory ( ) : string | Returns the new migrations directory where new migration classes are generated | |
getMigrationsNamespace ( ) : string | Returns the migrations namespace | |
getMigrationsTableName ( ) : string | Returns the migration table name | |
getMigrationsToExecute ( string $direction, string $to ) : |
Returns the array of migrations to executed based on the given direction and target version number. | |
getName ( ) : string | Returns the name of this set of migrations | |
getNextVersion ( ) : string | null | Returns the version following the current version. | |
getNumberOfAvailableMigrations ( ) : integer | Returns the total number of available migration versions | |
getNumberOfExecutedMigrations ( ) : integer | Returns the total number of executed migration versions | |
getOutputWriter ( ) : Doctrine\DBAL\Migrations\OutputWriter | Returns the OutputWriter instance | |
getPrevVersion ( ) : string | null | Returns the version prior to the current version. | |
getRelativeVersion ( $version, $delta ) : string | null | Returns the version with the specified offset to the specified version. | |
getVersion ( string $version ) : |
Returns the Version instance for a given version in the format YYYYMMDDHHMMSS. | |
hasVersion ( string $version ) : boolean | Check if a version exists. | |
hasVersionMigrated ( |
Check if a version has been migrated or not yet | |
registerMigration ( string $version, string $class ) : |
Register a single migration version to be executed by a AbstractMigration class. | |
registerMigrations ( array $migrations ) : |
Register an array of migrations. Each key of the array is the version and the value is the migration class name. | |
registerMigrationsFromDirectory ( string $path ) : |
Register migrations from a given directory. Recursively finds all files with the pattern VersionYYYYMMDDHHMMSS.php as the filename and registers them as migrations. | |
resolveVersionAlias ( $alias ) : string | null | Returns the version number from an alias. | |
setMigrationsAreOrganizedByYear ( boolean $migrationsAreOrganizedByYear = true ) | ||
setMigrationsAreOrganizedByYearAndMonth ( boolean $migrationsAreOrganizedByYearAndMonth = true ) | ||
setMigrationsColumnName ( string $columnName ) | Set the migration column name | |
setMigrationsDirectory ( string $migrationsDirectory ) | Set the new migrations directory where new migration classes are generated | |
setMigrationsFinder ( Doctrine\DBAL\Migrations\Finder\MigrationFinderInterface $finder ) | Set the implementation of the migration finder. | |
setMigrationsNamespace ( string $migrationsNamespace ) | Set the migrations namespace | |
setMigrationsTableName ( string $tableName ) | Set the migration table name | |
setName ( string $name ) | Set the name of this set of migrations | |
setOutputWriter ( Doctrine\DBAL\Migrations\OutputWriter $outputWriter ) | Sets the output writer. | |
validate ( ) | Validation that this instance has all the required properties configured |
Méthode | Description | |
---|---|---|
connect ( ) : boolean | Explicitely opens the database connection. This is done to play nice with DBAL's MasterSlaveConnection. Which, in some cases, connects to a follower when fetching the executed migrations. If a follower is lagging significantly behind that means the migrations system may see unexecuted migrations that were actually executed earlier. | |
findMigrations ( string $path ) : array | Find all the migrations in a given directory. |
Méthode | Description | |
---|---|---|
ensureMigrationClassExists ( string $class ) | ||
ensureOrganizeMigrationsIsCompatibleWithFinder ( ) | ||
shouldExecuteMigration ( string $direction, |
Check if we should execute a migration for a given direction and target migration version. |
public __construct ( Doctrine\DBAL\Connection $connection, Doctrine\DBAL\Migrations\OutputWriter $outputWriter = null, Doctrine\DBAL\Migrations\Finder\MigrationFinderInterface $finder = null ) | ||
$connection | Doctrine\DBAL\Connection | A Connection instance |
$outputWriter | Doctrine\DBAL\Migrations\OutputWriter | A OutputWriter instance |
$finder | Doctrine\DBAL\Migrations\Finder\MigrationFinderInterface | Migration files finder |
public areMigrationsOrganizedByYear ( ) : boolean | ||
Résultat | boolean |
public areMigrationsOrganizedByYearAndMonth ( ) : boolean | ||
Résultat | boolean |
public createMigrationTable ( ) : boolean | ||
Résultat | boolean | Whether or not the table was created. |
protected findMigrations ( string $path ) : array | ||
$path | string | the directory to search. |
Résultat | array |
public formatVersion ( string $version ) : string | ||
$version | string | |
Résultat | string | The formatted version |
public generateVersionNumber ( DateTimeInterface $now = null ) : string | ||
$now | DateTimeInterface | Defaults to the current time in UTC |
Résultat | string | The newly generated version |
public getAvailableVersions ( ) : array | ||
Résultat | array |
public getConnection ( ) : Doctrine\DBAL\Connection | ||
Résultat | Doctrine\DBAL\Connection | $connection The Connection instance |
public getCurrentVersion ( ) : string | ||
Résultat | string |
public getDateTime ( $version ) : string | ||
$version | ||
Résultat | string |
public getLatestVersion ( ) : string | ||
Résultat | string | The version string in the format YYYYMMDDHHMMSS. |
public getMigratedVersions ( ) : |
||
Résultat |
public getMigrations ( ) : |
||
Résultat | $migrations |
public getMigrationsColumnName ( ) : string | ||
Résultat | string | $migrationsColumnName The migration column name |
public getMigrationsDirectory ( ) : string | ||
Résultat | string | $migrationsDirectory The new migrations directory |
public getMigrationsNamespace ( ) : string | ||
Résultat | string | $migrationsNamespace The migrations namespace |
public getMigrationsTableName ( ) : string | ||
Résultat | string | $migrationsTableName The migration table name |
public getMigrationsToExecute ( string $direction, string $to ) : |
||
$direction | string | The direction we are migrating. |
$to | string | The version to migrate to. |
Résultat | $migrations The array of migrations we can execute. |
public getNextVersion ( ) : string | null | ||
Résultat | string | null | A version string, or null if the current version is the latest. |
public getNumberOfAvailableMigrations ( ) : integer | ||
Résultat | integer |
public getNumberOfExecutedMigrations ( ) : integer | ||
Résultat | integer |
public getOutputWriter ( ) : Doctrine\DBAL\Migrations\OutputWriter | ||
Résultat | Doctrine\DBAL\Migrations\OutputWriter | $outputWriter The OutputWriter instance |
public getPrevVersion ( ) : string | null | ||
Résultat | string | null | A version string, or null if the current version is the first. |
public getRelativeVersion ( $version, $delta ) : string | null | ||
Résultat | string | null | A version string, or null if the specified version is unknown or the specified delta is not within the list of available versions. |
public getVersion ( string $version ) : |
||
$version | string | The version string in the format YYYYMMDDHHMMSS. |
Résultat |
public hasVersion ( string $version ) : boolean | ||
$version | string | |
Résultat | boolean |
public hasVersionMigrated ( |
||
$version | ||
Résultat | boolean |
public registerMigration ( string $version, string $class ) : |
||
$version | string | The version of the migration in the format YYYYMMDDHHMMSS. |
$class | string | The migration class to execute for the version. |
Résultat |
public registerMigrations ( array $migrations ) : |
||
$migrations | array | |
Résultat |
public registerMigrationsFromDirectory ( string $path ) : |
||
$path | string | The root directory to where some migration classes live. |
Résultat | The array of migrations registered. |
public resolveVersionAlias ( $alias ) : string | null | ||
Résultat | string | null | A version number, or null if the specified alias does not map to an existing version, e.g. if "next" is passed but the current version is already the latest. |
public setMigrationsAreOrganizedByYear ( boolean $migrationsAreOrganizedByYear = true ) | ||
$migrationsAreOrganizedByYear | boolean |
public setMigrationsAreOrganizedByYearAndMonth ( boolean $migrationsAreOrganizedByYearAndMonth = true ) | ||
$migrationsAreOrganizedByYearAndMonth | boolean |
public setMigrationsColumnName ( string $columnName ) | ||
$columnName | string | The migration column name |
public setMigrationsDirectory ( string $migrationsDirectory ) | ||
$migrationsDirectory | string | The new migrations directory |
public setMigrationsFinder ( Doctrine\DBAL\Migrations\Finder\MigrationFinderInterface $finder ) | ||
$finder | Doctrine\DBAL\Migrations\Finder\MigrationFinderInterface | The new migration finder |
public setMigrationsNamespace ( string $migrationsNamespace ) | ||
$migrationsNamespace | string | The migrations namespace |
public setMigrationsTableName ( string $tableName ) | ||
$tableName | string | The migration table name |
public setOutputWriter ( Doctrine\DBAL\Migrations\OutputWriter $outputWriter ) | ||
$outputWriter | Doctrine\DBAL\Migrations\OutputWriter |
public validate ( ) |