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(Table[] $newTables = [], TableDiff[] $changedTables = [], Table[] $removedTables = [], Schema $fromSchema = null)

Constructs an SchemaDiff object.

array
toSaveSql(AbstractPlatform $platform)

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

array
toSql(AbstractPlatform $platform)

No description

array
_toSql(AbstractPlatform $platform, bool $saveMode = false)

No description

Details

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

Constructs an SchemaDiff object.

Parameters

Table[] $newTables
TableDiff[] $changedTables
Table[] $removedTables
Schema $fromSchema

array 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

array

array toSql(AbstractPlatform $platform)

Parameters

AbstractPlatform $platform

Return Value

array

protected array _toSql(AbstractPlatform $platform, bool $saveMode = false)

Parameters

AbstractPlatform $platform
bool $saveMode

Return Value

array