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
$changedSequences
public
array<string|int, Sequence>
$changedSequences
= []
$changedTables
All changed tables.
public
array<string|int, TableDiff>
$changedTables
= []
$fromSchema
public
Schema|null
$fromSchema
$newNamespaces
All added namespaces.
public
array<string|int, string>
$newNamespaces
= []
$newSequences
public
array<string|int, Sequence>
$newSequences
= []
$newTables
All added tables.
public
array<string|int, Table>
$newTables
= []
$orphanedForeignKeys
public
array<string|int, ForeignKeyConstraint>
$orphanedForeignKeys
= []
$removedNamespaces
All removed namespaces.
public
array<string|int, string>
$removedNamespaces
= []
$removedSequences
public
array<string|int, Sequence>
$removedSequences
= []
$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>
- Tables are deleted
- Sequences are deleted
- 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()
public
toSql(AbstractPlatform $platform) : array<string|int, string>
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