Files
itflow/admin/database_updates/4.2.9.php

29 lines
1.4 KiB
PHP

<?php
/*
* ITFlow - Database update to version 4.2.9 (from 4.2.8)
* Included by admin/database_updates.php - do not access directly
*
* The mail queue goes at a pace the mail host takes, and ticket email goes before bulk email:
* settings.config_mail_send_per_minute - the most emails sent a minute (Admin > Settings > Mail,
* Sending), 30 to start - what Microsoft 365 takes from one mailbox
* email_queue.email_bulk - 1 for an email from the contacts or clients list (Email), which waits
* behind everything else
*
* Re-runnable: each column is added only where it isn't there.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
$itflow_pace_columns = [
['settings', 'config_mail_send_per_minute', "int(11) NOT NULL DEFAULT 30 AFTER `config_smtp_password`"],
['email_queue', 'email_bulk', "tinyint(1) NOT NULL DEFAULT 0 AFTER `email_sensitive`"],
];
foreach ($itflow_pace_columns as [$itflow_table, $itflow_column, $itflow_definition]) {
$itflow_column_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '$itflow_table' AND COLUMN_NAME = '$itflow_column' LIMIT 1");
if (!$itflow_column_exists || mysqli_num_rows($itflow_column_exists) === 0) {
mysqli_query($mysqli, "ALTER TABLE `$itflow_table` ADD `$itflow_column` $itflow_definition");
}
}