mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
MINOR: made the execution of vacuuming configurable, cause its causing errors in some envs
This commit is contained in:
parent
92918be4fd
commit
016d848a87
@ -44,6 +44,8 @@ class SQLite3Database extends SS_Database {
|
|||||||
|
|
||||||
public static $default_pragma = array();
|
public static $default_pragma = array();
|
||||||
|
|
||||||
|
public static $vacuum = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect to a SQLite3 database.
|
* Connect to a SQLite3 database.
|
||||||
* @param array $parameters An map of parameters, which should include:
|
* @param array $parameters An map of parameters, which should include:
|
||||||
@ -358,8 +360,10 @@ class SQLite3Database extends SS_Database {
|
|||||||
$this->alterationMessage("SQLite$class Version " . $this->query("SELECT sqlite_version()")->value(),"repaired");
|
$this->alterationMessage("SQLite$class Version " . $this->query("SELECT sqlite_version()")->value(),"repaired");
|
||||||
$this->alterationMessage("Checking database integrity","repaired");
|
$this->alterationMessage("Checking database integrity","repaired");
|
||||||
if($msgs = $this->query('PRAGMA integrity_check')) foreach($msgs as $msg) if($msg['integrity_check'] != 'ok') { Debug::show($msg['integrity_check']); $ok = false; }
|
if($msgs = $this->query('PRAGMA integrity_check')) foreach($msgs as $msg) if($msg['integrity_check'] != 'ok') { Debug::show($msg['integrity_check']); $ok = false; }
|
||||||
$this->query('VACUUM');
|
if(self::$vacuum) {
|
||||||
$this->alterationMessage("VACUUMing","repaired");
|
$this->query('VACUUM');
|
||||||
|
$this->alterationMessage("VACUUMing","repaired");
|
||||||
|
}
|
||||||
self::$checked_and_repaired = true;
|
self::$checked_and_repaired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user