You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
650 B
PHP
19 lines
650 B
PHP
<?php
|
|
|
|
namespace v200;
|
|
|
|
|
|
class AddMissingKeyToTickets extends \AbstractMigration {
|
|
|
|
function up($hesk_settings) {
|
|
$keyRs = $this->executeQuery("SHOW KEYS FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE Key_name='statuses'");
|
|
if (hesk_dbNumRows($keyRs) == 0) {
|
|
//-- Add the key
|
|
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD KEY `statuses` (`status`)");
|
|
}
|
|
}
|
|
|
|
function down($hesk_settings) {
|
|
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP INDEX `statuses`");
|
|
}
|
|
} |