diff --git a/install/index.php b/install/index.php index 75448b3d..6ee2fc35 100644 --- a/install/index.php +++ b/install/index.php @@ -32,8 +32,8 @@ if (hesk_dbNumRows($tableSql) > 0) { '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, '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 + '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' => 153, + '3.1.1' => 154 ); $startingMigrationNumber = $migration_map[$versionRow['Value']]; } diff --git a/install/migrations/core.php b/install/migrations/core.php index 8b88cdf4..fb53f537 100644 --- a/install/migrations/core.php +++ b/install/migrations/core.php @@ -194,17 +194,24 @@ function getAllMigrations() { 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(), - 90 => new LegacyUpdateMigration('3.1.0', '3.0.7'), + 143 => new \v310\AddMoreColorOptionsToCategories\AddForegroundColor(), + 144 => new \v310\AddMoreColorOptionsToCategories\AddDisplayBorderOutline(), + 145 => new \v310\AddMoreColorOptionsToCategories\AddBackgroundColor(), + 146 => new \v310\AddNewLoginSettings\AddLoginBackgroundType(), + 147 => new \v310\AddNewLoginSettings\AddLoginBackground(), + 148 => new \v310\AddNewLoginSettings\AddLoginBoxHeader(), + 149 => new \v310\AddNewLoginSettings\AddLoginBoxHeaderImage(), + 150 => new \v310\AddApiUrlRewriteSetting(), + 151 => new \v310\ConvertPresetToIndividualColors(), + 152 => new LegacyUpdateMigration('3.1.0', '3.0.7'), //3.1.1 - 91 => new LegacyUpdateMigration('3.1.1', '3.1.0'), + 153 => new LegacyUpdateMigration('3.1.1', '3.1.0'), //3.2.0 - 92 => new \v320\AddDescriptionToCategoriesAndCustomFields(), - 93 => new \v320\AddAuditTrail(), - 94 => new \v320\AddMigrationSetting(), - 95 => new UpdateMigration('3.2.0', '3.1.1', 95), + 154 => new \v320\AddDescriptionToCategoriesAndCustomFields\AddDescriptionToCategories(), + 155 => new \v320\AddDescriptionToCategoriesAndCustomFields\AddDescriptionToCustomFields(), + 156 => new \v320\AddAuditTrail\CreateAuditTrailTable(), + 157 => new \v320\AddAuditTrail\CreateAuditTrailToReplacementValuesTable(), + 158 => new \v320\AddMigrationSetting(), + 159 => new UpdateMigration('3.2.0', '3.1.1', 159), ); } \ No newline at end of file diff --git a/install/migrations/v310/AddNewLoginSettings.php b/install/migrations/v310/AddNewLoginSettings.php deleted file mode 100644 index d37184d6..00000000 --- a/install/migrations/v310/AddNewLoginSettings.php +++ /dev/null @@ -1,21 +0,0 @@ -executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_background_type', 'color')"); - $this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_background', '#d2d6de')"); - $this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_box_header', 'helpdesk-title')"); - $this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_box_header_image', '')"); - } - - function down($hesk_settings) { - $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_background_type'"); - $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_background'"); - $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_box_header'"); - $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_box_header_image'"); - } -} \ No newline at end of file diff --git a/install/migrations/v310/AddNewLoginSettings/AddLoginBackground.php b/install/migrations/v310/AddNewLoginSettings/AddLoginBackground.php new file mode 100644 index 00000000..6f67ac4f --- /dev/null +++ b/install/migrations/v310/AddNewLoginSettings/AddLoginBackground.php @@ -0,0 +1,15 @@ +executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_background', '#d2d6de')"); + } + + function down($hesk_settings) { + $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_background'"); + } +} \ No newline at end of file diff --git a/install/migrations/v310/AddNewLoginSettings/AddLoginBackgroundType.php b/install/migrations/v310/AddNewLoginSettings/AddLoginBackgroundType.php new file mode 100644 index 00000000..ffd82f0a --- /dev/null +++ b/install/migrations/v310/AddNewLoginSettings/AddLoginBackgroundType.php @@ -0,0 +1,15 @@ +executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_background_type', 'color')"); + } + + function down($hesk_settings) { + $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_background_type'"); + } +} \ No newline at end of file diff --git a/install/migrations/v310/AddNewLoginSettings/AddLoginBoxHeader.php b/install/migrations/v310/AddNewLoginSettings/AddLoginBoxHeader.php new file mode 100644 index 00000000..624a741f --- /dev/null +++ b/install/migrations/v310/AddNewLoginSettings/AddLoginBoxHeader.php @@ -0,0 +1,15 @@ +executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_box_header', 'helpdesk-title')"); + } + + function down($hesk_settings) { + $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_box_header'"); + } +} \ No newline at end of file diff --git a/install/migrations/v310/AddNewLoginSettings/AddLoginBoxHeaderImage.php b/install/migrations/v310/AddNewLoginSettings/AddLoginBoxHeaderImage.php new file mode 100644 index 00000000..f0859cdf --- /dev/null +++ b/install/migrations/v310/AddNewLoginSettings/AddLoginBoxHeaderImage.php @@ -0,0 +1,15 @@ +executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('login_box_header_image', '')"); + } + + function down($hesk_settings) { + $this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'login_box_header_image'"); + } +} \ No newline at end of file diff --git a/install/migrations/v320/AddAuditTrail/CreateAuditTrailTable.php b/install/migrations/v320/AddAuditTrail/CreateAuditTrailTable.php new file mode 100644 index 00000000..3dadf4be --- /dev/null +++ b/install/migrations/v320/AddAuditTrail/CreateAuditTrailTable.php @@ -0,0 +1,20 @@ +executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail` ( + `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + `entity_id` INT NOT NULL, + `entity_type` VARCHAR(50) NOT NULL, + `language_key` VARCHAR(100) NOT NULL, + `date` TIMESTAMP NOT NULL)"); + } + + function down($hesk_settings) { + $this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail`"); + } +} \ No newline at end of file diff --git a/install/migrations/v320/AddAuditTrail.php b/install/migrations/v320/AddAuditTrail/CreateAuditTrailToReplacementValuesTable.php similarity index 51% rename from install/migrations/v320/AddAuditTrail.php rename to install/migrations/v320/AddAuditTrail/CreateAuditTrailToReplacementValuesTable.php index 7c0dc66f..93a009bb 100644 --- a/install/migrations/v320/AddAuditTrail.php +++ b/install/migrations/v320/AddAuditTrail/CreateAuditTrailToReplacementValuesTable.php @@ -1,17 +1,11 @@ executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail` ( - `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `entity_id` INT NOT NULL, - `entity_type` VARCHAR(50) NOT NULL, - `language_key` VARCHAR(100) NOT NULL, - `date` TIMESTAMP NOT NULL)"); $this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail_to_replacement_values` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `audit_trail_id` INT NOT NULL, @@ -20,7 +14,6 @@ class AddAuditTrail extends \AbstractMigration { } function down($hesk_settings) { - $this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail`"); $this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail_to_replacement_values`"); } } \ No newline at end of file diff --git a/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields/AddDescriptionToCategories.php b/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields/AddDescriptionToCategories.php new file mode 100644 index 00000000..aba2ffc5 --- /dev/null +++ b/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields/AddDescriptionToCategories.php @@ -0,0 +1,17 @@ +executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` + ADD COLUMN `mfh_description` TEXT"); + } + + function down($hesk_settings) { + $this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` + DROP COLUMN `mfh_description`"); + } +} \ No newline at end of file diff --git a/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields.php b/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields/AddDescriptionToCustomFields.php similarity index 70% rename from install/migrations/v320/AddDescriptionToCategoriesAndCustomFields.php rename to install/migrations/v320/AddDescriptionToCategoriesAndCustomFields/AddDescriptionToCustomFields.php index e242dc2f..bac58528 100644 --- a/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields.php +++ b/install/migrations/v320/AddDescriptionToCategoriesAndCustomFields/AddDescriptionToCustomFields.php @@ -1,13 +1,11 @@ executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` - ADD COLUMN `mfh_description` TEXT"); $this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_fields` ADD COLUMN `mfh_description` TEXT"); @@ -19,8 +17,6 @@ class AddDescriptionToCategoriesAndCustomFields extends \AbstractMigration { } function down($hesk_settings) { - $this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` - DROP COLUMN `mfh_description`"); $this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_fields` DROP COLUMN `mfh_description`"); diff --git a/install/migrations/v320/AddMigrationSetting.php b/install/migrations/v320/AddMigrationSetting.php index 72c9c0b3..c28cc17a 100644 --- a/install/migrations/v320/AddMigrationSetting.php +++ b/install/migrations/v320/AddMigrationSetting.php @@ -7,7 +7,7 @@ class AddMigrationSetting extends \AbstractMigration { function up($hesk_settings) { $this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) - VALUES ('migrationNumber', '94')"); + VALUES ('migrationNumber', '158')"); } function down($hesk_settings) {