PHP 클래스 Doctrine\DBAL\Migrations\Version

부터: 2.0
저자: Jonathan H. Wage ([email protected])
파일 보기 프로젝트 열기: doctrine/migrations 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Configuration $configuration, $version, $class, Doctrine\DBAL\Migrations\Provider\SchemaDiffProviderInterface $schemaProvider = null )
__toString ( )
addSql ( array | string $sql, array $params = [], array $types = [] ) Add some SQL queries to this versions migration
execute ( string $direction, boolean $dryRun = false, boolean $timeAllQueries = false ) : array Execute this migration version up or down and and return the SQL.
getConfiguration ( ) : Configuration Returns the Migrations Configuration object instance
getExecutionState ( )
getMigration ( ) : Doctrine\DBAL\Migrations\AbstractMigration
getTime ( ) : integer Returns the time this migration version took to execute
getVersion ( ) : string Returns the string version in the format YYYYMMDDHHMMSS
isMigrated ( ) : boolean Check if this version has been migrated or not.
markMigrated ( )
markNotMigrated ( )
writeSqlFile ( string $path, string $direction = self::DIRECTION_UP ) : boolean Write a migration SQL file to the given path

비공개 메소드들

메소드 설명
addQueryParams ( mixed[] $params, string[] $types )
executeRegisteredSql ( $dryRun = false, $timeAllQueries = false )
formatParamsForOutput ( array $params, array $types ) : string | null Formats a set of sql parameters for output with dry run.
markVersion ( $direction )
outputQueryTime ( $queryStart, $timeAllQueries = false )
outputSqlQuery ( integer $idx, string $query ) : void Outputs a SQL query via the OutputWriter.

메소드 상세

__construct() 공개 메소드

public __construct ( Configuration $configuration, $version, $class, Doctrine\DBAL\Migrations\Provider\SchemaDiffProviderInterface $schemaProvider = null )
$configuration Doctrine\DBAL\Migrations\Configuration\Configuration
$schemaProvider Doctrine\DBAL\Migrations\Provider\SchemaDiffProviderInterface

__toString() 공개 메소드

public __toString ( )

addSql() 공개 메소드

Add some SQL queries to this versions migration
public addSql ( array | string $sql, array $params = [], array $types = [] )
$sql array | string
$params array
$types array

execute() 공개 메소드

We are only allowing the addSql call and the schema modification to take effect in the up and down call. This is necessary to ensure that the migration is revertable. The schema is passed to the pre and post method only to be able to test the presence of some table, And the connection that can get used trough it allow for the test of the presence of records.
public execute ( string $direction, boolean $dryRun = false, boolean $timeAllQueries = false ) : array
$direction string The direction to execute the migration.
$dryRun boolean Whether to not actually execute the migration SQL and just do a dry run.
$timeAllQueries boolean Measuring or not the execution time of each SQL query.
리턴 array $sql

getConfiguration() 공개 메소드

Returns the Migrations Configuration object instance
public getConfiguration ( ) : Configuration
리턴 Doctrine\DBAL\Migrations\Configuration\Configuration $configuration

getExecutionState() 공개 메소드

public getExecutionState ( )

getMigration() 공개 메소드

public getMigration ( ) : Doctrine\DBAL\Migrations\AbstractMigration
리턴 Doctrine\DBAL\Migrations\AbstractMigration

getTime() 공개 메소드

Returns the time this migration version took to execute
public getTime ( ) : integer
리턴 integer $time The time this migration version took to execute

getVersion() 공개 메소드

Returns the string version in the format YYYYMMDDHHMMSS
public getVersion ( ) : string
리턴 string $version

isMigrated() 공개 메소드

Check if this version has been migrated or not.
public isMigrated ( ) : boolean
리턴 boolean

markMigrated() 공개 메소드

public markMigrated ( )

markNotMigrated() 공개 메소드

public markNotMigrated ( )

writeSqlFile() 공개 메소드

Write a migration SQL file to the given path
public writeSqlFile ( string $path, string $direction = self::DIRECTION_UP ) : boolean
$path string The path to write the migration SQL file.
$direction string The direction to execute.
리턴 boolean $written