◆ __construct()
Migrate constructor
- Paramètres
-
string | $dirname | module directory name that defines the tables to be migrated |
- Exceptions
-
◆ addMissingTable()
addMissingTable |
( |
|
$tableName | ) |
|
|
protected |
Add table create DDL to the work queue
- Paramètres
-
string | $tableName | table to add |
- Renvoie
- void
◆ getCurrentSchema()
get the current definitions
- Renvoie
- array
◆ getLastErrNo()
Return code from last error encountered
- Renvoie
- int last error number
◆ getLastError()
Return message from last error encountered
- Renvoie
- string last error message
◆ getSynchronizeDDL()
Compare target and current schema, building work queue in $this->migrate to synchronized
- Renvoie
- string[] array of DDL/SQL statements to transform current to target schema
◆ getTargetDefinitions()
Return the target database condition
- Renvoie
- array|bool table structure or false on error
- Exceptions
-
◆ preSyncActions()
Perform any upfront actions before synchronizing the schema.
The schema comparison cannot recognize changes such as renamed columns or renamed tables. By overriding this method, an implementation can provide the logic to accomplish these types of changes, and leave the other details to be handled by synchronizeSchema().
An suitable implementation should be provided by a module by extending Migrate to define any required actions.
Some typical uses include:
- table and column renames
- data conversions
- move column data
- Renvoie
- void
◆ saveCurrentSchema()
Save current table definitions to a file
This is intended for developer use when setting up the migration by using the current database state
◆ synchronizeSchema()
synchronizeSchema |
( |
|
$force = true | ) |
|
Execute synchronization to transform current schema to target
- Paramètres
-
bool | $force | true to force updates even if this is a 'GET' request |
- Renvoie
- bool true if no errors, false if errors encountered
◆ synchronizeTable()
synchronizeTable |
( |
|
$tableName | ) |
|
|
protected |
Build any DDL required to synchronize an existing table to match the target schema
- Paramètres
-
string | $tableName | table to synchronize |
- Renvoie
- void
◆ targetHasColumn()
targetHasColumn |
( |
|
$tableName, |
|
|
|
$columnName |
|
) |
| |
|
protected |
determine if a column on a table exists in the target definitions
- Paramètres
-
string | $tableName | table containing the column |
string | $columnName | column to check |
- Renvoie
- bool true if table and column combination is defined, otherwise false
◆ targetHasTable()
targetHasTable |
( |
|
$tableName | ) |
|
|
protected |
determine if a table exists in the target definitions
- Paramètres
-
string | $tableName | table containing the column |
- Renvoie
- bool true if table is defined, otherwise false
◆ $helper
◆ $moduleTables
◆ $tableDefinitionFile
◆ $tableHandler
◆ $targetDefinitions
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/libraries/vendor/xoops/xmf/src/Database/Migrate.php