3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Helpers for managing SQL-backed queue items
21 * @see CRM_Queue_Queue_Sql
23 class CRM_Queue_BAO_QueueItem
extends CRM_Queue_DAO_QueueItem
{
26 * Ensure that the required SQL table exists.
28 * The `civicrm_queue_item` table is a special requirement - without it, the upgrader cannot run.
29 * The upgrader will make a special request for `findCreateTable()` before computing upgrade-tasks.
32 * TRUE if table now exists
34 public static function findCreateTable(): bool {
35 if (!CRM_Core_DAO
::checkTableExists('civicrm_queue_item')) {
36 // Table originated in 4.2. We no longer support direct upgrades from <=4.2. Don't bother trying to create table.
40 return static::updateTable();
45 * Ensure that the `civicrm_queue_item` table is up-to-date.
49 public static function updateTable(): bool {
50 CRM_Upgrade_Incremental_Base
::addColumn(NULL, 'civicrm_queue_item', 'run_count',
51 "int NOT NULL DEFAULT 0 COMMENT 'Number of times execution has been attempted.'");