Files
itflow/admin/database_updates/4.4.1.php

21 lines
1.0 KiB
PHP

<?php
/*
* ITFlow - Database update to version 4.4.1 (from 4.4.0)
* Included by admin/database_updates.php - do not access directly
*
* contacts.contact_email_alt - a contact's alternate email address, beside contact_email: shown and searched with it,
* exported, imported and in the API, and email from it is the contact's - their new tickets and their replies
* (contactEmailSql(), functions/contact.php). What ITFlow sends goes to contact_email alone.
*
* Re-runnable: the column is made only where it isn't there.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
$itflow_email_alt = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'contacts' AND COLUMN_NAME = 'contact_email_alt' LIMIT 1");
if (!$itflow_email_alt || mysqli_num_rows($itflow_email_alt) === 0) {
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_email_alt` varchar(200) DEFAULT NULL AFTER `contact_email`");
}