diff --git a/install/index.php b/install/index.php index 4e49d9d4..75448b3d 100644 --- a/install/index.php +++ b/install/index.php @@ -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']]; diff --git a/install/migrations/core.php b/install/migrations/core.php index 992e9cd4..8b88cdf4 100644 --- a/install/migrations/core.php +++ b/install/migrations/core.php @@ -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(), diff --git a/install/migrations/v310/AddCustomNavElements/CreateCustomNavElementTable.php b/install/migrations/v310/AddCustomNavElements/CreateCustomNavElementTable.php new file mode 100644 index 00000000..ff2bc037 --- /dev/null +++ b/install/migrations/v310/AddCustomNavElements/CreateCustomNavElementTable.php @@ -0,0 +1,21 @@ +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`"); + } +} \ No newline at end of file diff --git a/install/migrations/v310/AddCustomNavElements.php b/install/migrations/v310/AddCustomNavElements/CreateCustomNavElementToTextTable.php similarity index 51% rename from install/migrations/v310/AddCustomNavElements.php rename to install/migrations/v310/AddCustomNavElements/CreateCustomNavElementToTextTable.php index a3585df6..87eff45e 100644 --- a/install/migrations/v310/AddCustomNavElements.php +++ b/install/migrations/v310/AddCustomNavElements/CreateCustomNavElementToTextTable.php @@ -1,18 +1,11 @@ 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`"); } } \ No newline at end of file diff --git a/install/migrations/v310/AddMoreColorOptionsToCategories.php b/install/migrations/v310/AddMoreColorOptionsToCategories.php deleted file mode 100644 index 41e21d2d..00000000 --- a/install/migrations/v310/AddMoreColorOptionsToCategories.php +++ /dev/null @@ -1,20 +0,0 @@ -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'"); - } -} \ No newline at end of file diff --git a/install/migrations/v310/AddMoreColorOptionsToCategories/AddBackgroundColor.php b/install/migrations/v310/AddMoreColorOptionsToCategories/AddBackgroundColor.php new file mode 100644 index 00000000..c8d819b5 --- /dev/null +++ b/install/migrations/v310/AddMoreColorOptionsToCategories/AddBackgroundColor.php @@ -0,0 +1,16 @@ +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'"); + } +} \ No newline at end of file diff --git a/install/migrations/v310/AddMoreColorOptionsToCategories/AddDisplayBorderOutline.php b/install/migrations/v310/AddMoreColorOptionsToCategories/AddDisplayBorderOutline.php new file mode 100644 index 00000000..87855a3e --- /dev/null +++ b/install/migrations/v310/AddMoreColorOptionsToCategories/AddDisplayBorderOutline.php @@ -0,0 +1,15 @@ +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`"); + } +} \ No newline at end of file diff --git a/install/migrations/v310/AddMoreColorOptionsToCategories/AddForegroundColor.php b/install/migrations/v310/AddMoreColorOptionsToCategories/AddForegroundColor.php new file mode 100644 index 00000000..fcef4303 --- /dev/null +++ b/install/migrations/v310/AddMoreColorOptionsToCategories/AddForegroundColor.php @@ -0,0 +1,15 @@ +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`"); + } +} \ No newline at end of file