Permalink
Browse files

Fixed issue #14309: Upgrade to 3.15 SQL Error

  • Loading branch information...
dominikvitt committed Feb 7, 2019
1 parent 276d22f commit 450677a5928ba2c27dde852a4c77c74006859fb7
Showing with 3 additions and 0 deletions.
  1. +3 −0 application/helpers/update/updatedb_helper.php
@@ -49,6 +49,7 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
/// older versions to match current functionality
Yii::app()->loadHelper('database');
Yii::app()->loadHelper('admin/import');
$sUserTemplateRootDir = Yii::app()->getConfig('userthemerootdir');
$sStandardTemplateRootDir = Yii::app()->getConfig('standardthemerootdir');
$oDB = Yii::app()->getDb();
@@ -2285,12 +2286,14 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
$aIdMap = [];
$aDefaultSurveyMenus = LsDefaultDataSets::getSurveyMenuData();
switchMSSQLIdentityInsert('surveymenu', true);
foreach ($aDefaultSurveyMenus as $i => $aSurveymenu) {
$oDB->createCommand()->delete('{{surveymenu}}', 'name=:name', [':name' => $aSurveymenu['name']]);
$oDB->createCommand()->delete('{{surveymenu}}', 'id=:id', [':id' => $aSurveymenu['id']]);
$oDB->createCommand()->insert('{{surveymenu}}', $aSurveymenu);
$aIdMap[$aSurveymenu['name']] = $aSurveymenu['id'];
}
switchMSSQLIdentityInsert('surveymenu', false);
$aDefaultSurveyMenuEntries = LsDefaultDataSets::getSurveyMenuEntryData();
foreach($aDefaultSurveyMenuEntries as $i => $aSurveymenuentry) {

1 comment on commit 450677a

@Shnoulle

This comment has been minimized.

Copy link
Collaborator

Shnoulle commented on 450677a Feb 8, 2019

Arg different fix in develop : 80860f8

Please sign in to comment.