Fix version update

This commit is contained in:
Unknown 2018-05-13 23:41:32 +02:00
parent edbd2da4eb
commit 9dea19b9b1
1 changed files with 8 additions and 1 deletions

View File

@ -315,8 +315,15 @@ class meta extends Repo_i {
}
if($default != null){
$set .= "default=:default,";
$set .= "`default`=:default,";
$execute["default"] = $default?1:0;
//if default = true, set previous default version to non-default
if($default == true){
$req = $this->pdo->prepare("UPDATE meta_vhost.`databases` SET `default`=0 WHERE departement_iddepartement=:idDep");
$req->execute(["idDep" => $_SESSION['CurrentDepartmentId']]);
}
}
$set = rtrim($set,",");