Comparator extends Comparator

Compares two Schemas and returns an instance of SchemaDiff.

Internal

not part of public core API.

Table of Contents

Properties

$databasePlatform  : AbstractPlatform
$platform  : AbstractPlatform

Methods

__construct()  : mixed
compareSchemas()  : SchemaDiff
compareTables()  : TableDiff
Returns the difference between the tables $fromTable and $toTable.
doctrineDbalMajorThreeDiffColumn()  : array<string|int, string>
Returns the difference between the columns
typo3DiffColumn()  : array<string|int, mixed>
Returns the difference between the columns $column1 and $column2 by first checking the doctrine diffColumn. Extend the Doctrine method by taking into account MySQL TINY/MEDIUM/LONG type variants.
columnsEqual()  : bool

Properties

$databasePlatform

protected AbstractPlatform $databasePlatform

$platform

protected AbstractPlatform $platform

Methods

__construct()

public __construct(AbstractPlatform $platform) : mixed
Parameters
$platform : AbstractPlatform

compareSchemas()

public compareSchemas(Schema $oldSchema, Schema $newSchema) : SchemaDiff
Parameters
$oldSchema : Schema
$newSchema : Schema
Return values
SchemaDiff

compareTables()

Returns the difference between the tables $fromTable and $toTable.

public compareTables(Table $oldTable, Table $newTable) : TableDiff

If there are no differences this method returns the boolean false.

Parameters
$oldTable : Table
$newTable : Table
Return values
TableDiff

doctrineDbalMajorThreeDiffColumn()

Returns the difference between the columns

public doctrineDbalMajorThreeDiffColumn(Column $column1, Column $column2) : array<string|int, string>
Deprecated

Use columnsEqual() instead.

If there are differences this method returns the changed properties as a string array, otherwise an empty array gets returned.

Parameters
$column1 : Column
$column2 : Column
Return values
array<string|int, string>

Note: cloned from doctrine/dbal 3.7.1

typo3DiffColumn()

Returns the difference between the columns $column1 and $column2 by first checking the doctrine diffColumn. Extend the Doctrine method by taking into account MySQL TINY/MEDIUM/LONG type variants.

public typo3DiffColumn(Column $column1, Column $column2) : array<string|int, mixed>
Parameters
$column1 : Column
$column2 : Column
Tags
todo

Move the column length override for MariaDB/MySQL to the extended platform classes, when the the workaround here can be removed and `AbstractPlatform::columnsEqual() used. Currently blocked by the used Comparator::doctrineDbalMajorThreeDiffColumn() code which compares differently than the new platform code of doctrine. See the todo regarding the platform options in that method.

see
Comparator::doctrineDbalMajorThreeDiffColumn()

blocker

Return values
array<string|int, mixed>

columnsEqual()

protected columnsEqual(Column $column1, Column $column2) : bool
Parameters
$column1 : Column
$column2 : Column
Tags
todo:

Remove this override after blocking issues has been resolved in the methods Comparator::typo3DiffColumn() and Comparator::doctrineDbalMajorThreeDiffColumn().

see
Comparator::typo3DiffColumn()

blocker, see comments

see
Comparator::doctrineDbalMajorThreeDiffColumn()

blocker, see comments

Return values
bool

        
On this page

Search results