Commit 202534dc authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3679, Automatic DB update - Schema & FormEditor

Also respect version numbers which are not configured in DatabaseUpdateData.php and between two configured version numbers.
parent 05b32a30
......@@ -116,6 +116,8 @@ class DatabaseUpdate {
}
/**
* Play all update statement with version number are '>' than $old and '<=' to $new.
*
* @param $old
* @param $new
*/
......@@ -128,23 +130,18 @@ class DatabaseUpdate {
$apply = false;
foreach ($updateArray as $key => $sqlStatements) {
// Search starting point to apply updates
$rc = version_compare($key, $old);
if ($rc == 1) {
$apply = true;
}
if ($apply) {
// Play Statements
foreach ($sqlStatements as $sql) {
$this->db->sql($sql);
}
}
switch ($key) {
case $old:
$apply = true;
break;
case $new:
$apply = false;
break;
default:
break;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment