Skip to content

Commit

Permalink
Changed all wrong attributes values ('Y'/'N') to (1/0) in table quest…
Browse files Browse the repository at this point in the history
…ion_attributes
  • Loading branch information
Trischi80 committed Feb 23, 2021
1 parent 5130316 commit 424b623
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
59 changes: 59 additions & 0 deletions application/helpers/update/updatedb_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3628,9 +3628,68 @@ function ($v) {
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'hidden' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'hidden' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'statistics_showgraph' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'statistics_showgraph' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'public_statistics' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'public_statistics' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'page_break' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'page_break' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'other_numbers_only' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'other_numbers_only' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'other_comment_mandatory' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'other_comment_mandatory' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'hide_tip' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'hide_tip' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'exclude_all_others_auto' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'exclude_all_others_auto' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'commented_checkbox_auto' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'commented_checkbox_auto' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'num_value_int_only' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'num_value_int_only' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'alphasort' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'alphasort' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'use_dropdown' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'use_dropdown' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'num_value_int_only' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'num_value_int_only' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'slider_default_set' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'slider_default_set' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'slider_layout' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'slider_layout' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'slider_middlestart' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'slider_middlestart' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'slider_reset' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'slider_reset' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'slider_reversed' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'slider_reversed' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'slider_showminmax' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'slider_showminmax' and value = 'N'");

$oDB->createCommand()->update('{{question_attributes}}', array('value' => '1'), "attribute = 'value_range_allows_missing' and value = 'Y'");
$oDB->createCommand()->update('{{question_attributes}}', array('value' => '0'), "attribute = 'value_range_allows_missing' and value = 'N'");


$oDB->createCommand()->update('{{settings_global}}', array('stg_value' => 438), "stg_name='DBVersion'");
$oTransaction->commit();
}

} catch (Exception $e) {
Yii::app()->setConfig('Updating', false);
$oTransaction->rollback();
Expand Down
2 changes: 1 addition & 1 deletion application/models/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @property integer $question_order Question order in greoup
* @property integer $parent_qid Questions parent question ID eg for subquestions
* @property integer $scale_id The scale ID
* @property integer $same_default Saves if user set to use the same default value across languages in default options dialog
* @property integer $same_default Saves if user set to use the same default value across languages in default options dialog ('Edit default answers')
* @property string $relevance Questions relevane equation
* @property string $modulename
*
Expand Down

0 comments on commit 424b623

Please sign in to comment.