From 12348b9adf4c90c345b44e43d92754c726faf88d Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Fri, 7 May 2021 06:55:12 +0200 Subject: [PATCH] Do not retrieve current version update script --- galette/lib/Galette/Core/Install.php | 4 ++-- tests/Galette/Core/tests/units/Install.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/galette/lib/Galette/Core/Install.php b/galette/lib/Galette/Core/Install.php index 22e8778aa..ed72a524c 100644 --- a/galette/lib/Galette/Core/Install.php +++ b/galette/lib/Galette/Core/Install.php @@ -590,7 +590,7 @@ class Install if ($version === null) { $php_update_scripts[$ver[1]] = $ver[1]; } else { - if ($version <= $ver[1]) { + if ($version < $ver[1]) { $php_update_scripts[$ver[1]] = $file; } } @@ -605,7 +605,7 @@ class Install if ($version === null) { $sql_update_scripts[$ver[1]] = $ver[1]; } else { - if ($version <= $ver[1]) { + if ($version < $ver[1]) { $sql_update_scripts[$ver[1]] = $file; } } diff --git a/tests/Galette/Core/tests/units/Install.php b/tests/Galette/Core/tests/units/Install.php index 958d3398f..c87a52c49 100644 --- a/tests/Galette/Core/tests/units/Install.php +++ b/tests/Galette/Core/tests/units/Install.php @@ -110,7 +110,6 @@ class Install extends atoum ); $knowns = array( - '0.60' => 'upgrade-to-0.60-pgsql.sql', '0.61' => 'upgrade-to-0.61-pgsql.sql', '0.62' => 'upgrade-to-0.62-pgsql.sql', '0.63' => 'upgrade-to-0.63-pgsql.sql', @@ -149,9 +148,10 @@ class Install extends atoum ); //without specifying database nor version, we got 10 update scripts total + $all_knowns = ['0.60' => 'upgrade-to-0.60-pgsql.sql'] + $knowns; $this->array(array_values($update_scripts)) - ->hasSize(count($knowns)) - ->isEqualTo(array_keys($knowns)); + ->hasSize(count($all_knowns)) + ->isEqualTo(array_keys($all_knowns)); $this->install->setMode(\Galette\Core\Install::UPDATE); $errors = array(); -- 2.39.2