mediatekformation

SchemaDiff
in package

Differences between two schemas.

The object contains the operations to change the schema stored in $fromSchema to a target schema.

Table of Contents

$changedSequences  : array<string|int, Sequence>
$changedTables  : array<string|int, TableDiff>
All changed tables.
$fromSchema  : Schema|null
$newNamespaces  : array<string|int, string>
All added namespaces.
$newSequences  : array<string|int, Sequence>
$newTables  : array<string|int, Table>
All added tables.
$orphanedForeignKeys  : array<string|int, ForeignKeyConstraint>
$removedNamespaces  : array<string|int, string>
All removed namespaces.
$removedSequences  : array<string|int, Sequence>
$removedTables  : array<string|int, Table>
All removed tables.
__construct()  : mixed
Constructs an SchemaDiff object.
toSaveSql()  : array<string|int, string>
The to save sql mode ensures that the following things don't happen:
toSql()  : array<string|int, string>
_toSql()  : array<string|int, string>

Properties

$newNamespaces

All added namespaces.

public array<string|int, string> $newNamespaces = []

$newTables

All added tables.

public array<string|int, Table> $newTables = []

$removedNamespaces

All removed namespaces.

public array<string|int, string> $removedNamespaces = []

$removedTables

All removed tables.

public array<string|int, Table> $removedTables = []

Methods

__construct()

Constructs an SchemaDiff object.

public __construct([array<string|int, Table$newTables = [] ][, array<string|int, TableDiff$changedTables = [] ][, array<string|int, Table$removedTables = [] ][, Schema|null $fromSchema = null ]) : mixed
Parameters
$newTables : array<string|int, Table> = []
$changedTables : array<string|int, TableDiff> = []
$removedTables : array<string|int, Table> = []
$fromSchema : Schema|null = null
Return values
mixed

toSaveSql()

The to save sql mode ensures that the following things don't happen:

public toSaveSql(AbstractPlatform $platform) : array<string|int, string>
  1. Tables are deleted
  2. Sequences are deleted
  3. Foreign Keys which reference tables that would otherwise be deleted.

This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all.

Parameters
$platform : AbstractPlatform
Return values
array<string|int, string>

_toSql()

protected _toSql(AbstractPlatform $platform[, bool $saveMode = false ]) : array<string|int, string>
Parameters
$platform : AbstractPlatform
$saveMode : bool = false
Return values
array<string|int, string>

Search results