class SchemaDiff (View source)

Schema Diff.

Properties

Schema $fromSchema
string[] $newNamespaces All added namespaces.
string[] $removedNamespaces All removed namespaces.
Table[] $newTables All added tables.
TableDiff[] $changedTables All changed tables.
Table[] $removedTables All removed tables.
Sequence[] $newSequences
Sequence[] $changedSequences
Sequence[] $removedSequences
ForeignKeyConstraint[] $orphanedForeignKeys

Methods

__construct($newTables = [], $changedTables = [], $removedTables = [], Schema|null $fromSchema = null)

Constructs an SchemaDiff object.

string[]
toSaveSql(AbstractPlatform $platform)

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

string[]
toSql(AbstractPlatform $platform)

No description

string[]
_toSql(AbstractPlatform $platform, $saveMode = false)

No description

Details

__construct($newTables = [], $changedTables = [], $removedTables = [], Schema|null $fromSchema = null)

Constructs an SchemaDiff object.

Parameters

$newTables
$changedTables
$removedTables
Schema|null $fromSchema

string[] toSaveSql(AbstractPlatform $platform)

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

  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

AbstractPlatform $platform

Return Value

string[]

string[] toSql(AbstractPlatform $platform)

Parameters

AbstractPlatform $platform

Return Value

string[]

protected string[] _toSql(AbstractPlatform $platform, $saveMode = false)

Parameters

AbstractPlatform $platform
$saveMode

Return Value

string[]