Xmf\Database\Migrate
For a given module, compare the existing tables with a defined target schema and build a work queue of DDL/SQL to transform the existing tables to the target definitions.
Typically, Migrate will be extended by a module specific class that will supply custom logic (see preSyncActions() method.)
Methods | ||
---|---|---|
public
|
__construct(string $dirname)
|
# |
public
|
getCurrentSchema(): array
|
# |
public
|
getTargetDefinitions(): array|bool
|
# |
public
|
synchronizeSchema(bool $force = true): bool
|
# |
public
|
getSynchronizeDDL(): string[]
|
# |
protected
|
preSyncActions(): void
|
# |
protected
|
addMissingTable(string $tableName): void
|
# |
protected
|
synchronizeTable(string $tableName): void
|
# |
protected
|
targetHasColumn(string $tableName, string $columnName): bool
|
# |
protected
|
targetHasTable(string $tableName): bool
|
# |
public
|
getLastError(): string
|
# |
public
|
getLastErrNo(): int
|
# |
Properties | |||
---|---|---|---|
protected
|
false|Helper|HelperAbstract
|
$helper
|
# |
protected
|
string[]
|
$moduleTables
|
# |
protected
|
Tables
|
$tableHandler
|
# |
protected
|
string
|
$tableDefinitionFile
|
# |
protected
|
array
|
$targetDefinitions
|
# |