Some more changes

master
Mike Koch 7 years ago
parent f6df4fda7e
commit 9b7af18f6a
No known key found for this signature in database
GPG Key ID: 9BA5D7F8391455ED

@ -31,8 +31,8 @@ if (hesk_dbNumRows($tableSql) > 0) {
'1.6.0' => 22, '1.6.1' => 23, '1.7.0' => 27, '2.0.0' => 37, '2.0.1' => 38, '2.1.0' => 39, '2.1.1' => 42,
'2.2.0' => 47, '2.2.1' => 48, '2.3.0' => 68, '2.3.1' => 69, '2.3.2' => 70, '2.4.0' => 86, '2.4.1' => 87,
'2.4.2' => 88, '2.5.0' => 98, '2.5.1' => 99, '2.5.2' => 100, '2.5.3' => 101, '2.5.4' => 102, '2.5.5' => 103,
'2.6.0' => 121, '2.6.1' => 122, '2.6.2' => 125, '2.6.3' => 126, '2.6.4' => 127, /*TODO*/ '3.0.0' => 132, '3.0.1' => 133,
'3.0.2' => 78, '3.0.3' => 79, '3.0.4' => 80, '3.0.5' => 81, '3.0.6' => 82, '3.0.7' => 83, '3.1.0' => 90,
'2.6.0' => 121, '2.6.1' => 122, '2.6.2' => 125, '2.6.3' => 126, '2.6.4' => 127, '3.0.0' => 132, '3.0.1' => 133,
'3.0.2' => 135, '3.0.3' => 136, '3.0.4' => 137, '3.0.5' => 138, '3.0.6' => 139, '3.0.7' => 140, '3.1.0' => 90,
'3.1.1' => 91
);
$startingMigrationNumber = $migration_map[$versionRow['Value']];

@ -182,19 +182,19 @@ function getAllMigrations() {
//3.0.1
132 => new LegacyUpdateMigration('3.0.1', '3.0.0'),
//3.0.2
// TODO
133 => new \v302\AddMissingCustomFields(),
78 => new LegacyUpdateMigration('3.0.2', '3.0.1'),
134 => new LegacyUpdateMigration('3.0.2', '3.0.1'),
//3.0.3 - 3.0.7
79 => new LegacyUpdateMigration('3.0.3', '3.0.2'),
80 => new LegacyUpdateMigration('3.0.4', '3.0.3'),
81 => new LegacyUpdateMigration('3.0.5', '3.0.4'),
82 => new LegacyUpdateMigration('3.0.6', '3.0.5'),
83 => new LegacyUpdateMigration('3.0.7', '3.0.6'),
135 => new LegacyUpdateMigration('3.0.3', '3.0.2'),
136 => new LegacyUpdateMigration('3.0.4', '3.0.3'),
137 => new LegacyUpdateMigration('3.0.5', '3.0.4'),
138 => new LegacyUpdateMigration('3.0.6', '3.0.5'),
139 => new LegacyUpdateMigration('3.0.7', '3.0.6'),
//3.1.0
84 => new \v310\AddStackTraceToLogs(),
85 => new \v310\AddCustomNavElements(),
86 => new \v310\AddMoreColorOptionsToCategories(),
140 => new \v310\AddStackTraceToLogs(),
141 => new \v310\AddCustomNavElements\CreateCustomNavElementTable(),
142 => new \v310\AddCustomNavElements\CreateCustomNavElementToTextTable(),
86 => new \v310\AddForegroundColor(),
87 => new \v310\AddNewLoginSettings(),
88 => new \v310\AddApiUrlRewriteSetting(),
89 => new \v310\ConvertPresetToIndividualColors(),

@ -0,0 +1,21 @@
<?php
namespace v310\AddCustomNavElements;
class CreateCustomNavElementTable extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element`
(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
image_url TEXT,
font_icon VARCHAR(200),
place INT NOT NULL,
url VARCHAR(500) NOT NULL,
sort INT NOT NULL)");
}
function down($hesk_settings) {
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element`");
}
}

@ -1,18 +1,11 @@
<?php
namespace v310;
namespace v310\AddCustomNavElements;
class AddCustomNavElements extends \AbstractMigration {
class CreateCustomNavElementToTextTable extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element`
(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
image_url TEXT,
font_icon VARCHAR(200),
place INT NOT NULL,
url VARCHAR(500) NOT NULL,
sort INT NOT NULL)");
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element_to_text`
(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
nav_element_id INT NOT NULL,
@ -22,7 +15,6 @@ class AddCustomNavElements extends \AbstractMigration {
}
function down($hesk_settings) {
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element`");
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element_to_text`");
}
}

@ -1,20 +0,0 @@
<?php
namespace v310;
class AddMoreColorOptionsToCategories extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `foreground_color` VARCHAR(7) NOT NULL DEFAULT 'AUTO'");
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `display_border_outline` ENUM('0','1') NOT NULL DEFAULT '0'");
$this->executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` SET `color` = '#FFFFFF' WHERE `color` IS NULL");
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` CHANGE `color` `background_color` VARCHAR(7) NOT NULL DEFAULT '#FFFFFF'");
}
function down($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `foreground_color`");
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `display_border_outline`");
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` CHANGE `background_color` `color` VARCHAR(7) NOT NULL DEFAULT '#FFFFFF'");
}
}

@ -0,0 +1,16 @@
<?php
namespace v310\AddMoreColorOptionsToCategories;
class AddBackgroundColor extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` SET `color` = '#FFFFFF' WHERE `color` IS NULL");
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` CHANGE `color` `background_color` VARCHAR(7) NOT NULL DEFAULT '#FFFFFF'");
}
function down($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` CHANGE `background_color` `color` VARCHAR(7) NOT NULL DEFAULT '#FFFFFF'");
}
}

@ -0,0 +1,15 @@
<?php
namespace v310\AddMoreColorOptionsToCategories;
class AddDisplayBorderOutline extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `display_border_outline` ENUM('0','1') NOT NULL DEFAULT '0'");
}
function down($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `display_border_outline`");
}
}

@ -0,0 +1,15 @@
<?php
namespace v310\AddMoreColorOptionsToCategories;
class AddForegroundColor extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `foreground_color` VARCHAR(7) NOT NULL DEFAULT 'AUTO'");
}
function down($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `foreground_color`");
}
}
Loading…
Cancel
Save