diff options
author | Thomas Lange <code@nerdmind.de> | 2021-07-01 19:40:45 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-07-01 19:40:45 +0200 |
commit | a0fddb8470f33d7c66ff79cdbf9956290d72db25 (patch) | |
tree | 080c977735fa3df3dcf1df63c68f8b372b20583f | |
parent | 53bda002825112a0e121f063f659b53492fbb615 (diff) | |
download | blog-a0fddb8470f33d7c66ff79cdbf9956290d72db25.tar.gz blog-a0fddb8470f33d7c66ff79cdbf9956290d72db25.tar.xz blog-a0fddb8470f33d7c66ff79cdbf9956290d72db25.zip |
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".
-rw-r--r-- | core/namespace/Migrator.php | 3 |
1 files changed, 2 insertions, 1 deletions
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!'); } |