Merge pull request #9047 from annando/no-item-delivery-data

The table "item-delivery-data" does not exist on newer systems
This commit is contained in:
Tobias Diekershoff 2020-08-22 13:17:49 +02:00 committed by GitHub
commit 9a3d04dce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -456,6 +456,11 @@ class PostUpdate
return true;
}
if (!DBStructure::existsTable('item-delivery-data')) {
DI::config()->set('system', 'post_update_version', 1297);
return true;
}
$max_item_delivery_data = DBA::selectFirst('item-delivery-data', ['iid'], ['queue_count > 0 OR queue_done > 0'], ['order' => ['iid']]);
$max_iid = $max_item_delivery_data['iid'];
@ -700,6 +705,11 @@ class PostUpdate
return true;
}
if (!DBStructure::existsTable('item-delivery-data')) {
DI::config()->set('system', 'post_update_version', 1345);
return true;
}
$id = DI::config()->get('system', 'post_update_version_1345_id', 0);
Logger::info('Start', ['item' => $id]);

View file

@ -348,7 +348,9 @@ function update_1309()
function update_1315()
{
DBA::delete('item-delivery-data', ['postopts' => '', 'inform' => '', 'queue_count' => 0, 'queue_done' => 0]);
if (DBStructure::existsTable('item-delivery-data')) {
DBA::delete('item-delivery-data', ['postopts' => '', 'inform' => '', 'queue_count' => 0, 'queue_done' => 0]);
}
return Update::SUCCESS;
}