From a0fddb8470f33d7c66ff79cdbf9956290d72db25 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 1 Jul 2021 19:40:45 +0200 Subject: Bugfix: Explicitly check for FALSE in Migrator Explicitly check for boolean FALSE because the result can be string "0" when directly upgrading from release v1.0 which has schema version "0". --- core/namespace/Migrator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/namespace/Migrator.php b/core/namespace/Migrator.php index 1a05cc1..6eec9a5 100644 --- a/core/namespace/Migrator.php +++ b/core/namespace/Migrator.php @@ -16,7 +16,8 @@ class Migrator { try { $Statement = $Database->query('SELECT schema_version FROM migration'); - if(!$this->version = $Statement->fetchColumn()) { + # Explicitly check for FALSE, because result can be "0" + if(($this->version = $Statement->fetchColumn()) === FALSE) { throw new Exception('The migration table does exist, but there is no row containing the currently used on-disk schema version!'); } -- cgit v1.2.3