|
Changelog.SQL
v1.2-1-g4629c08
|
Read changelog.sql directory and compare it with database.
Public Member Functions | |
| __construct ($pdo) | |
| Constructor. More... | |
| getDatabaseInfo () | |
| Returns info about currently used database (it should be short string) More... | |
| loadChangelogDir ($dir, $use_git) | |
| Load SQL scripts from changelog directory. More... | |
| loadChangelogTable ($table) | |
| Load records from changelog table. More... | |
| compare () | |
| Compare loaded data. More... | |
| needsUpdate () | |
| Get list of updates to perform. More... | |
| needsExec () | |
| Get list of scripts to execute. More... | |
| getInsertQuery ($script) | |
| Generate SQL query suitable for inserting new record into changelog. More... | |
| getScriptSql ($script) | |
| Get content of the SQL script. More... | |
| loadInitScriptsDir ($dir) | |
| Load scripts with init files. More... | |
| initScripts () | |
| Get list of init scripts to execute. More... | |
| getInitScriptSql ($script) | |
| Get content of the SQL init script. More... | |
Protected Attributes | |
| $pdo | |
| PDO database driver. More... | |
| $scripts = array() | |
| SQL scripts from changelog. More... | |
| $changelog = array() | |
| List of completed scripts (loaded from database). More... | |
| $init_scripts = array() | |
| SQL scripts from init directory. More... | |
| $needs_update = null | |
| List of scripts which needs to be manualy updated. More... | |
| $needs_exec = null | |
| List of scripts which needs to be executed. More... | |
| __construct | ( | $pdo | ) |
Constructor.
| $pdo | is PDO instance connected to database. |
| getDatabaseInfo | ( | ) |
Returns info about currently used database (it should be short string)
| loadChangelogDir | ( | $dir, | |
| $use_git | |||
| ) |
Load SQL scripts from changelog directory.
| loadChangelogTable | ( | $table | ) |
Load records from changelog table.
| compare | ( | ) |
Compare loaded data.
| needsUpdate | ( | ) |
Get list of updates to perform.
| needsExec | ( | ) |
Get list of scripts to execute.
| getInsertQuery | ( | $script | ) |
Generate SQL query suitable for inserting new record into changelog.
| getScriptSql | ( | $script | ) |
Get content of the SQL script.
| loadInitScriptsDir | ( | $dir | ) |
Load scripts with init files.
| initScripts | ( | ) |
Get list of init scripts to execute.
| getInitScriptSql | ( | $script | ) |
Get content of the SQL init script.
|
protected |
PDO database driver.
|
protected |
SQL scripts from changelog.
|
protected |
List of completed scripts (loaded from database).
|
protected |
SQL scripts from init directory.
|
protected |
List of scripts which needs to be manualy updated.
|
protected |
List of scripts which needs to be executed.
1.8.11