Skip to content

Commit

Permalink
Fixes for update procedure
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@12180 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jan 24, 2012
1 parent 9bfaf5d commit 427c875
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 352 deletions.
2 changes: 1 addition & 1 deletion application/helpers/update/update_helper.php
Expand Up @@ -29,7 +29,7 @@ function CheckForDBUpgrades($subaction = null)
if(isset($subaction) && $subaction=="yes")
{
echo Yii::app()->getController()->_getAdminHeader();
echo "<div style='width:90%; padding:1% 10%;background-color:#eee;'>";
echo "<div style='width:90%; padding:1% 5%;background-color:#eee;'>";
$upgradedbtype=Yii::app()->db->getDriverName();
if ($upgradedbtype=='mysqli') $upgradedbtype='mysql';
Yii::app()->loadHelper('update/upgrade-'.$upgradedbtype);
Expand Down
19 changes: 8 additions & 11 deletions application/helpers/update/upgrade-all_helper.php
Expand Up @@ -64,21 +64,21 @@ function db_upgrade_all($oldversion) {
'targetqid' => 'INT NULL',
'targetsqid' => 'INT NULL'
);
Yii::app()->db->schema->createTable('{{survey_url_parameters}}',$fields);
Yii::app()->db->createCommand()->createTable('{{survey_url_parameters}}',$fields);
}
if ($oldversion < 150)
{
$fields = array(
'relevance' => 'TEXT'
);
Yii::app()->db->schema->addColumn('{{questions}}','relevance','TEXT');
Yii::app()->db->createCommand()->addColumn('{{questions}}','relevance','TEXT');
}
if ($oldversion < 151)
{
$fields = array(
'randomization_group' => 'VARCHAR(20) NOT NULL default \'\''
);
Yii::app()->db->schema->addColumn('{{groups}}','randomization_group','VARCHAR(20) NOT NULL default \'\'');
Yii::app()->db->createCommand()->addColumn('{{groups}}','randomization_group','VARCHAR(20) NOT NULL default \'\'');
}
if ($oldversion < 152)
{
Expand All @@ -99,11 +99,11 @@ function db_upgrade_all($oldversion) {
'eqn' => 'TEXT',
'prettyprint' => 'TEXT'
);
Yii::app()->db->schema->createTable('{{expression_errors}}',$fields);
Yii::app()->db->createCommand()->createTable('{{expression_errors}}',$fields);
}

if ($oldversion < 155)
Yii::app()->db->createCommand(Yii::app()->db->schema->addColumn('{{surveys_languagesettings}}', 'surveyls_attributecaptions', "text NOT NULL default ''"))->execute();
Yii::app()->db->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_attributecaptions', "text NOT NULL default ''");
}

function upgrade_question_attributes148()
Expand Down Expand Up @@ -297,15 +297,12 @@ function upgrade_survey_table152()

if (trim(strip_tags($aSurveyRow['surveyls_email_confirm'])) == '')
{

$sSurveyUpdateQuery= "update {{surveys}} set sendconfirmation='N' where sid=".$aSurveyRow['surveyls_survey_id'];
Yii::app()->db->createCommand($sSurveyUpdateQuery)->execute();

$sSurveyUpdateQuery= "update {{surveys_languagesettings}} set
surveyls_email_confirm_subj=".$aDefaultTexts['confirmation_subject'].",
surveyls_email_confirm=".$aDefaultTexts['confirmation']."
where surveyls_survey_id=".$aSurveyRow['surveyls_survey_id'];
Yii::app()->db->createCommand($sSurveyUpdateQuery)->execute();
$aValues=array('surveyls_email_confirm_subj'=>$aDefaultTexts['confirmation_subject'],
'surveyls_email_confirm'=>$aDefaultTexts['confirmation']);
Surveys_languagesettings::model()->updateAll($aValues,'surveyls_survey_id=:sid',array(':sid'=>$aSurveyRow['surveyls_survey_id']));
}
}
}

0 comments on commit 427c875

Please sign in to comment.