0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed "Unable to update nested relation" errors when rolling back migrations

no issue

- we recently started wrapping rollbacks in transactions (https://github.com/TryGhost/knex-migrator/pull/161)
- in a number of migrations we were calling `model.destroy()` without passing through the options which includes the current transaction
- for models which are using `bookshelf-relations` this could result in an internal `SQLITE_BUSY: database is locked` error because it tries to run queries against tables that have been locked by previous queries in the transaction
- by passing through the options when calling `.destroy()` it allows the `bookshelf-relations` to re-use the same transction avoiding the database lock problems
This commit is contained in:
Kevin Ansfield 2019-08-20 11:20:34 +01:00
parent 1b09ae9200
commit f038fbe0aa
4 changed files with 4 additions and 4 deletions

View file

@ -53,7 +53,7 @@ _private.removeApiKeyPermissionsAndRole = (options) => {
return;
}
return role.destroy().then(() => {
return role.destroy(options).then(() => {
logging.info(message);
});
});

View file

@ -53,7 +53,7 @@ _private.removeApiKeyPermissionsAndRole = (options) => {
return;
}
return role.destroy().then(() => {
return role.destroy(options).then(() => {
logging.info(message);
});
});

View file

@ -40,7 +40,7 @@ _private.removeGhostBackupIntegration = (options) => {
return;
}
return integration.destroy().then(() => {
return integration.destroy(options).then(() => {
logging.info(message);
});
});

View file

@ -40,7 +40,7 @@ _private.removeGhostSchedulerIntegration = (options) => {
return;
}
return integration.destroy().then(() => {
return integration.destroy(options).then(() => {
logging.info(message);
});
});