Skip to content

Commit

Permalink
Update DB for name change of attrib fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mfaber authored and unknown committed Jul 22, 2013
1 parent c9207a2 commit b02a738
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -13,7 +13,7 @@
*/

$config['versionnumber'] = "2.05b4";
$config['dbversionnumber'] = 169;
$config['dbversionnumber'] = 170;
$config['buildnumber'] = '';
$config['updatable'] = true;

Expand Down
9 changes: 7 additions & 2 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -1124,10 +1124,15 @@ function db_upgrade_all($oldversion) {
// Remove old column.
Yii::app()->getDb()->createCommand()->dropColumn('{{surveys}}', 'allowjumps');
$db->createCommand()->update('{{settings_global}}',array('stg_value'=>169),"stg_name='DBVersion'");

}


if ($oldversion < 170)
{
// renamed advanced attributes fields dropdown_dates_year_min/max
$db->createCommand()->update('{{question_attributes}}',array('attribute'=>'date_min'),"attribute='dropdown_dates_year_min'");
$db->createCommand()->update('{{question_attributes}}',array('attribute'=>'date_max'),"attribute='dropdown_dates_year_max'");
$db->createCommand()->update('{{settings_global}}',array('stg_value'=>170),"stg_name='DBVersion'");
}
$oTransaction->commit();
}
catch(Exception $e)
Expand Down
2 changes: 1 addition & 1 deletion installer/sql/create-mssql.sql
Expand Up @@ -575,4 +575,4 @@ create unique index [permissions_idx2] ON [lime_permissions] ([entity_id], [enti
--
-- Version Info
--
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '169');
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '170');
2 changes: 1 addition & 1 deletion installer/sql/create-mysql.sql
Expand Up @@ -581,4 +581,4 @@ create index `parent_qid_idx` on `prefix_questions` (`parent_qid`);
--
-- Version Info
--
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '169');
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '170');
2 changes: 1 addition & 1 deletion installer/sql/create-pgsql.sql
Expand Up @@ -585,4 +585,4 @@ create unique index permissions_idx2 ON lime_permissions (entity_id, entity_name
--
-- Version Info
--
INSERT INTO prefix_settings_global VALUES ('DBVersion', '169');
INSERT INTO prefix_settings_global VALUES ('DBVersion', '170');

0 comments on commit b02a738

Please sign in to comment.