Restore
in package
Database restore and truncation operations.
Tags
Table of Contents
Methods
- restoreFile() : string
- Restore the database from a file.
- truncateUserDatabase() : void
- Truncate the database, remove all data belonging by the current user.
- dropAllLwtTables() : void
- Drop all LWT tables to prepare for a clean restore.
Methods
restoreFile()
Restore the database from a file.
public
static restoreFile(resource $handle, string $title[, bool $validateSql = true ]) : string
Parameters
- $handle : resource
-
Backup file handle
- $title : string
-
File title
- $validateSql : bool = true
-
Whether to validate SQL statements (default true)
Tags
Return values
string —Human-readable status message
truncateUserDatabase()
Truncate the database, remove all data belonging by the current user.
public
static truncateUserDatabase() : void
Keep settings.
dropAllLwtTables()
Drop all LWT tables to prepare for a clean restore.
private
static dropAllLwtTables() : void
This is needed to ensure migrations run on a clean slate and don't fail due to partial state from previous attempts.