Finished converting migrations. Need to test.

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

@ -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']];
}

@ -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),
);
}

@ -1,21 +0,0 @@
<?php
namespace v310;
class AddNewLoginSettings extends \AbstractMigration {
function up($hesk_settings) {
$this->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'");
}
}

@ -0,0 +1,15 @@
<?php
namespace v310\AddNewLoginSettings;
class AddLoginBackground extends \AbstractMigration {
function up($hesk_settings) {
$this->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'");
}
}

@ -0,0 +1,15 @@
<?php
namespace v310\AddNewLoginSettings;
class AddLoginBackgroundType extends \AbstractMigration {
function up($hesk_settings) {
$this->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'");
}
}

@ -0,0 +1,15 @@
<?php
namespace v310\AddNewLoginSettings;
class AddLoginBoxHeader extends \AbstractMigration {
function up($hesk_settings) {
$this->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'");
}
}

@ -0,0 +1,15 @@
<?php
namespace v310\AddNewLoginSettings;
class AddLoginBoxHeaderImage extends \AbstractMigration {
function up($hesk_settings) {
$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_box_header_image'");
}
}

@ -0,0 +1,20 @@
<?php
namespace v320\AddAuditTrail;
class CreateAuditTrailTable extends \AbstractMigration {
function up($hesk_settings) {
$this->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`");
}
}

@ -1,17 +1,11 @@
<?php
namespace v320;
namespace v320\AddAuditTrail;
class AddAuditTrail extends \AbstractMigration {
class CreateAuditTrailToReplacementValuesTable extends \AbstractMigration {
function up($hesk_settings) {
$this->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`");
}
}

@ -0,0 +1,17 @@
<?php
namespace v320\AddDescriptionToCategoriesAndCustomFields;
class AddDescriptionToCategories extends \AbstractMigration {
function up($hesk_settings) {
$this->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`");
}
}

@ -1,13 +1,11 @@
<?php
namespace v320;
namespace v320\AddDescriptionToCategoriesAndCustomFields;
class AddDescriptionToCategoriesAndCustomFields extends \AbstractMigration {
class AddDescriptionToCustomFields extends \AbstractMigration {
function up($hesk_settings) {
$this->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`");

@ -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) {

Loading…
Cancel
Save