PHP 클래스 Migrations\Shell\Task\MigrationDiffTask

상속: extends Migrations\Shell\Task\SimpleMigrationTask, use trait Migrations\Shell\Task\SnapshotTrait, use trait Migrations\Util\UtilTrait
파일 보기 프로젝트 열기: cakephp/migrations

보호된 프로퍼티들

프로퍼티 타입 설명
$commonTables array List of the tables that are commonly found in the dump schema and the current schema
$currentSchema array Array of \Cake\Database\Schema\Table objects from the current state of the database
$dumpSchema array Array of \Cake\Database\Schema\Table objects from the dump file which represents the state of the database after the last migrate / rollback command
$migratedItems array Array of migrations that have already been migrated
$migrationsFiles array Migration files that are stored in the self::migrationsPath
$migrationsPath string Path to the migration files
$phinxTable string Name of the phinx log table
$tables array List the tables the connection currently holds
$templateData {@inheritDoc}

공개 메소드들

메소드 설명
bake ( $name ) {@inheritDoc}
getCollection ( string $connection ) : Cake\Database\Schema\Collection Get a collection from a database.
getOptionParser ( ) : Cake\Console\ConsoleOptionParser Gets the option parser instance and configures it.
setup ( ) : void Sets up everything the baking process needs
template ( ) {@inheritDoc}
templateData ( ) : array Process and prepare the data needed for the bake template to be generated.

보호된 메소드들

메소드 설명
bakeSnapshot ( $name ) : integer Fallback method called to bake a snapshot when the phinx log history is empty and there are no migration files.
calculateDiff ( ) : void This methods runs the various methods needed to calculate a diff between the current state of the database and the schema dump file.
checkSync ( ) : boolean Checks that the migrations history is in sync with the migrations files
getColumns ( ) : void Calculate the diff between columns in existing tables.
getConstraints ( ) : void Calculate the diff between contraints in existing tables.
getCurrentSchema ( ) : array Reflects the current database schema.
getDumpSchema ( ) : array Fetch the correct schema dump based on the arguments and options passed to the shell call and returns it as an array
getIndexes ( ) : void Calculate the diff between indexes in existing tables.
getTables ( ) : void Calculate the diff between the current state of the database and the schema dump by returning an array containing the full \Cake\Database\Schema\Table definitions of tables to be created and removed in the diff file.

메소드 상세

bake() 공개 메소드

{@inheritDoc}
public bake ( $name )

bakeSnapshot() 보호된 메소드

Fallback method called to bake a snapshot when the phinx log history is empty and there are no migration files.
protected bakeSnapshot ( $name ) : integer
리턴 integer Value of the snapshot baking dispatch process

calculateDiff() 보호된 메소드

This methods runs the various methods needed to calculate a diff between the current state of the database and the schema dump file.
protected calculateDiff ( ) : void
리턴 void

checkSync() 보호된 메소드

Checks that the migrations history is in sync with the migrations files
protected checkSync ( ) : boolean
리턴 boolean Whether migrations history is sync or not

getCollection() 공개 메소드

Get a collection from a database.
public getCollection ( string $connection ) : Cake\Database\Schema\Collection
$connection string Database connection name.
리턴 Cake\Database\Schema\Collection

getColumns() 보호된 메소드

This will look for columns addition, columns removal and changes in columns metadata such as change of types or property such as length. Note that the method is not able to detect columns name change. The method directly sets the diff in a property of the class.
protected getColumns ( ) : void
리턴 void

getConstraints() 보호된 메소드

This will look for contraints addition, contraints removal and changes in contraints metadata such as change of referenced columns if the old constraints and the new one have the same name. The method directly sets the diff in a property of the class.
protected getConstraints ( ) : void
리턴 void

getCurrentSchema() 보호된 메소드

Reflects the current database schema.
protected getCurrentSchema ( ) : array
리턴 array Full database schema : the key is the name of the table and the value is an instance of \Cake\Database\Schema\Table.

getDumpSchema() 보호된 메소드

Fetch the correct schema dump based on the arguments and options passed to the shell call and returns it as an array
protected getDumpSchema ( ) : array
리턴 array Full database schema : the key is the name of the table and the value is an instance of \Cake\Database\Schema\Table.

getIndexes() 보호된 메소드

This will look for indexes addition, indexes removal and changes in indexes metadata such as change of referenced columns if the old indexes and the new one have the same name. The method directly sets the diff in a property of the class.
protected getIndexes ( ) : void
리턴 void

getOptionParser() 공개 메소드

Gets the option parser instance and configures it.
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser
리턴 Cake\Console\ConsoleOptionParser

getTables() 보호된 메소드

The method directly sets the diff in a property of the class.
protected getTables ( ) : void
리턴 void

setup() 공개 메소드

Sets up everything the baking process needs
public setup ( ) : void
리턴 void

template() 공개 메소드

{@inheritDoc}
public template ( )

templateData() 공개 메소드

Process and prepare the data needed for the bake template to be generated.
public templateData ( ) : array
리턴 array

프로퍼티 상세

$commonTables 보호되어 있는 프로퍼티

List of the tables that are commonly found in the dump schema and the current schema
protected array $commonTables
리턴 array

$currentSchema 보호되어 있는 프로퍼티

Array of \Cake\Database\Schema\Table objects from the current state of the database
protected array $currentSchema
리턴 array

$dumpSchema 보호되어 있는 프로퍼티

Array of \Cake\Database\Schema\Table objects from the dump file which represents the state of the database after the last migrate / rollback command
protected array $dumpSchema
리턴 array

$migratedItems 보호되어 있는 프로퍼티

Array of migrations that have already been migrated
protected array $migratedItems
리턴 array

$migrationsFiles 보호되어 있는 프로퍼티

Migration files that are stored in the self::migrationsPath
protected array $migrationsFiles
리턴 array

$migrationsPath 보호되어 있는 프로퍼티

Path to the migration files
protected string $migrationsPath
리턴 string

$phinxTable 보호되어 있는 프로퍼티

Name of the phinx log table
protected string $phinxTable
리턴 string

$tables 보호되어 있는 프로퍼티

List the tables the connection currently holds
protected array $tables
리턴 array

$templateData 보호되어 있는 프로퍼티

{@inheritDoc}
protected $templateData