mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Destroyed connection before restoring DB file
no issue - we've seen some instances of SQLite saying "database disk image is malformed" - I think this happens because we copy the file whilst we are still connected to the old DB - this commit destroys the connection before copying the clean file to the live DB file
This commit is contained in:
parent
9c0752896c
commit
4673bd05fc
@ -26,6 +26,7 @@ module.exports.reset = async () => {
|
||||
const dbExists = await fs.pathExists(filenameOrig);
|
||||
|
||||
if (dbExists) {
|
||||
await db.knex.destroy();
|
||||
await fs.copyFile(filenameOrig, filename);
|
||||
} else {
|
||||
await knexMigrator.reset({force: true});
|
||||
|
Loading…
Reference in New Issue
Block a user