Update install.php

Populate sccpdevmodel if empty
This commit is contained in:
steve-lad 2021-03-13 16:48:41 +01:00 committed by Diederik de Groot
parent 3ed43600d4
commit c4cd6cbdbf
No known key found for this signature in database
GPG key ID: AFA728250A1BECD6

View file

@ -993,8 +993,14 @@ if ($sccp_compatible > 431) {
InstallDB_sccpsettings();
InstallDB_sccpdevmodel();
InstallDB_updateSchema($db_config);
if (!$sccp_db_ver) {
$stmt = $db->prepare('SELECT CASE WHEN EXISTS(SELECT 1 FROM sccpdevmodel) THEN 0 ELSE 1 END AS IsEmpty;');
$stmt->execute();
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
if ($result[0]['IsEmpty']) {
outn("Populating sccpdevmodel...");
InstallDB_fillsccpdevmodel();
}
if (!$sccp_db_ver) {
InstallDB_updateSccpDevice();
} else {
outn("Skip update Device model");