Issue #3145412 by pavnish, cburschka, amateescu: Connection::__destruct() can't delete the sqlite file
parent
1a48485ede
commit
0073e14852
|
@ -187,9 +187,9 @@ class Connection extends DatabaseConnection {
|
|||
|
||||
// We can prune the database file if it doesn't have any tables.
|
||||
if ($count == 0 && $this->connectionOptions['database'] != ':memory:' && file_exists($this->connectionOptions['database'] . '-' . $prefix)) {
|
||||
// Detaching the database fails at this point, but no other queries
|
||||
// are executed after the connection is destructed so we can simply
|
||||
// remove the database file.
|
||||
// Detach the database.
|
||||
$this->query('DETACH DATABASE :schema', [':schema' => $prefix]);
|
||||
// Destroy the database file.
|
||||
unlink($this->connectionOptions['database'] . '-' . $prefix);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue