mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
24 lines
1.3 KiB
PHP
24 lines
1.3 KiB
PHP
<?php
|
|
|
|
/*
|
|
* ITFlow - Database update to version 4.3.6 (from 4.3.5)
|
|
* Included by admin/database_updates.php - do not access directly
|
|
*
|
|
* sms_providers.sms_provider_send - whether texts go out through the provider (1), or it only takes texts in (0,
|
|
* Receive only: texts to the number still become tickets, replies and codes, and nothing is texted - for a number
|
|
* that can't send yet, or a service where sending is a hassle to set up). Every provider set up already sends.
|
|
*
|
|
* Re-runnable: the column is made only where it isn't there.
|
|
*/
|
|
|
|
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
|
|
|
|
$itflow_sms_table = mysqli_query($mysqli, "SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'sms_providers' LIMIT 1");
|
|
if ($itflow_sms_table && mysqli_num_rows($itflow_sms_table) > 0) {
|
|
$itflow_send_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS
|
|
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'sms_providers' AND COLUMN_NAME = 'sms_provider_send' LIMIT 1");
|
|
if (!$itflow_send_exists || mysqli_num_rows($itflow_send_exists) === 0) {
|
|
mysqli_query($mysqli, "ALTER TABLE `sms_providers` ADD `sms_provider_send` tinyint(1) NOT NULL DEFAULT 1 AFTER `sms_provider_active`");
|
|
}
|
|
}
|