Finished up 3.0.0 refactoring

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

@ -31,7 +31,7 @@ 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' => 75, '3.0.1' => 76,
'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,
'3.1.1' => 91
);

@ -175,14 +175,15 @@ function getAllMigrations() {
126 => new LegacyUpdateMigration('2.6.4', '2.6.3'),
//3.0.0
127 => new \v300\MigrateHeskCustomStatuses(),
// TODO
73 => new \v300\MigrateAutorefreshOption(),
74 => new \v300\AddColorSchemeSetting(),
75 => new LegacyUpdateMigration('3.0.0', '2.6.4'),
128 => new \v300\MigrateAutorefreshOption\UpdateFromOldValue(),
129 => new \v300\MigrateAutorefreshOption\DropOldColumn(),
130 => new \v300\AddColorSchemeSetting(),
131 => new LegacyUpdateMigration('3.0.0', '2.6.4'),
//3.0.1
76 => new LegacyUpdateMigration('3.0.1', '3.0.0'),
132 => new LegacyUpdateMigration('3.0.1', '3.0.0'),
//3.0.2
77 => new \v302\AddMissingCustomFields(),
// TODO
133 => new \v302\AddMissingCustomFields(),
78 => new LegacyUpdateMigration('3.0.2', '3.0.1'),
//3.0.3 - 3.0.7
79 => new LegacyUpdateMigration('3.0.3', '3.0.2'),

@ -1,17 +1,15 @@
<?php
namespace v300;
namespace v300\MigrateAutorefreshOption;
class MigrateAutorefreshOption extends \AbstractMigration {
class DropOldColumn extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `autoreload` = `autorefresh` / 10");
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `autorefresh`");
}
function down($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ADD COLUMN `autorefresh` BIGINT NOT NULL DEFAULT 0");
$this->executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `autorefresh` = `autoreload` * 10");
}
}

@ -0,0 +1,15 @@
<?php
namespace v300\MigrateAutorefreshOption;
class UpdateFromOldValue extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `autoreload` = `autorefresh` / 10");
}
function down($hesk_settings) {
$this->executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `autorefresh` = `autoreload` * 10");
}
}
Loading…
Cancel
Save