|
Changelog.SQL
v1.2
|
Read changelog.sql directory and compare it with database. More...
Public Member Functions | |
| __construct ($pdo) | |
| Constructor. More... | |
| getDatabaseInfo () | |
| Returns info about currently used database (it should be short string) | |
| loadChangelogDir ($dir, $use_git) | |
| Load SQL scripts from changelog directory. More... | |
| loadChangelogTable ($table) | |
| Load records from changelog table. More... | |
| 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 Attributes | |
| $pdo | |
| PDO database driver. | |
| $scripts = array() | |
| SQL scripts from changelog. | |
| $changelog = array() | |
| List of completed scripts (loaded from database). | |
| $init_scripts = array() | |
| SQL scripts from init directory. | |
| $needs_update = null | |
| List of scripts which needs to be manualy updated. | |
| $needs_exec = null | |
| List of scripts which needs to be executed. | |
Read changelog.sql directory and compare it with database.
| __construct | ( | $pdo | ) |
Constructor.
| $pdo | is PDO instance connected to database. |
| loadChangelogDir | ( | $dir, | |
| $use_git | |||
| ) |
Load SQL scripts from changelog directory.
| loadChangelogTable | ( | $table | ) |
Load records from changelog table.
1.8.11