PHP Класс Migrations\Shell\Task\MigrationDiffTask

Наследование: extends Migrations\Shell\Task\SimpleMigrationTask, use trait Migrations\Shell\Task\SnapshotTrait, use trait Migrations\Util\UtilTrait
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$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