diff --git a/install/index.php b/install/index.php index 376ed24e..4e49d9d4 100644 --- a/install/index.php +++ b/install/index.php @@ -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 ); diff --git a/install/migrations/core.php b/install/migrations/core.php index 60e7b860..992e9cd4 100644 --- a/install/migrations/core.php +++ b/install/migrations/core.php @@ -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'), diff --git a/install/migrations/v300/MigrateAutorefreshOption.php b/install/migrations/v300/MigrateAutorefreshOption/DropOldColumn.php similarity index 51% rename from install/migrations/v300/MigrateAutorefreshOption.php rename to install/migrations/v300/MigrateAutorefreshOption/DropOldColumn.php index 3a1366ba..76fa0305 100644 --- a/install/migrations/v300/MigrateAutorefreshOption.php +++ b/install/migrations/v300/MigrateAutorefreshOption/DropOldColumn.php @@ -1,17 +1,15 @@ 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"); } } \ No newline at end of file diff --git a/install/migrations/v300/MigrateAutorefreshOption/UpdateFromOldValue.php b/install/migrations/v300/MigrateAutorefreshOption/UpdateFromOldValue.php new file mode 100644 index 00000000..7ea1bb57 --- /dev/null +++ b/install/migrations/v300/MigrateAutorefreshOption/UpdateFromOldValue.php @@ -0,0 +1,15 @@ +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"); + } +} \ No newline at end of file