◆ __construct()
Migrate constructor
- Parameters
-
string | $dirname | module directory name that defines the tables to be migrated |
- Exceptions
-
InvalidArgumentException
- Exceptions
-
RuntimeException
◆ addMissingTable()
addMissingTable |
( |
|
$tableName | ) |
|
|
protected |
Add table create DDL to the work queue
- Parameters
-
string | $tableName | table to add |
- Returns
- void
◆ getCurrentSchema()
get the current definitions
- Returns
- array
◆ getLastErrNo()
Return code from last error encountered
- Returns
- int last error number
◆ getLastError()
Return message from last error encountered
- Returns
- string last error message
◆ getSynchronizeDDL()
Compare target and current schema, building work queue in $this->migrate to synchronized
- Returns
- string[] array of DDL/SQL statements to transform current to target schema
◆ getTargetDefinitions()
Return the target database condition
- Returns
- array|bool table structure or false on error
- Exceptions
-
RuntimeException
◆ 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
- Returns
- 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
- Parameters
-
bool | $force | true to force updates even if this is a 'GET' request |
- Returns
- 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
- Parameters
-
string | $tableName | table to synchronize |
- Returns
- void
◆ targetHasColumn()
targetHasColumn |
( |
|
$tableName, |
|
|
|
$columnName |
|
) |
| |
|
protected |
determine if a column on a table exists in the target definitions
- Parameters
-
string | $tableName | table containing the column |
string | $columnName | column to check |
- Returns
- bool true if table and column combination is defined, otherwise false
◆ targetHasTable()
targetHasTable |
( |
|
$tableName | ) |
|
|
protected |
determine if a table exists in the target definitions
- Parameters
-
string | $tableName | table containing the column |
- Returns
- bool true if table is defined, otherwise false
◆ $helper
◆ $moduleTables
◆ $tableDefinitionFile
◆ $tableHandler
◆ $targetDefinitions
The documentation for this class was generated from the following file:
- C:/xoops2511b2/htdocs/class/libraries/vendor/xoops/xmf/src/Database/Migrate.php