Fix DbUpdate not updating nntmux.xml properly

This commit is contained in:
DariusIII
2017-08-11 09:38:05 +02:00
parent 94841f40cb
commit cd6a8fb842
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
</last>
</scripts>
<sql>
<db>314</db>
<db>315</db>
<file>315</file>
</sql>
</versions>
+5 -3
View File
@@ -165,6 +165,8 @@ class DbUpdate
* numbers to order them. i.e. +1~settings.sql, +2~predb.sql, etc.
*
* @param array $options
*
* @throws \Exception
*/
public function newPatches(array $options = [])
{
@@ -195,7 +197,7 @@ class DbUpdate
} else {
echo $this->log->header('Processing patch file: ' . $file);
$this->splitSQL($file, ['local' => $local, 'data' => $options['data']]);
$current = (integer)Settings::value('..sqlpatch');
$current = Settings::value('..sqlpatch');
$current++;
$this->pdo->queryExec("UPDATE settings SET value = '$current' WHERE setting = 'sqlpatch';");
$newName = $matches['drive'] . $matches['path'] .
@@ -248,7 +250,7 @@ class DbUpdate
$patch,
$matches)
) {
$patch = (integer)$matches['patch'];
$patch = (int)$matches['patch'];
} else {
throw new \RuntimeException("No patch information available, stopping!!");
}
@@ -259,7 +261,7 @@ class DbUpdate
}
$this->splitSQL($file, ['local' => $local, 'data' => $data]);
if ($setPatch) {
$this->pdo->queryExec("UPDATE settings SET value = '$patch' WHERE setting = 'sqlpatch';");
Settings::query()->where('setting', '=', 'sqlpatch')->update(['value' => $patch]);
}
$patched++;
}