Skip to content

Commit

Permalink
Dev: Make dbversion start on 400 for LS4 to avoid conflict with master
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jun 5, 2018
1 parent 859ccd0 commit d8ae3b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// The current version of this branch, LS4
$config['versionnumber'] = '4.0.0dev';
$config['dbversionnumber'] = 402;
$config['dbversionnumber'] = 403;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '40000';
Expand Down
16 changes: 8 additions & 8 deletions application/helpers/update/updatedb_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
}


if ($iOldDBVersion < 350) {
if ($iOldDBVersion < 400) {
// This update moves localization-dependant strings from question group/question/answer tables to related localization tables
$oTransaction = $oDB->beginTransaction();

Expand Down Expand Up @@ -2340,44 +2340,44 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
$oDB->createCommand()->dropPrimaryKey('{{defaultvalues_pk}}','{{defaultvalues}}');
$oDB->createCommand()->addPrimaryKey('{{defaultvalues_pk}}', '{{defaultvalues}}', ['qid', 'specialtype', 'scale_id', 'sqid']);

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

$oTransaction->commit();
}

/**
* Add load_error and load_error_message to plugin system.
*/
if ($iOldDBVersion < 400) {
if ($iOldDBVersion < 401) {
$oTransaction = $oDB->beginTransaction();

$oDB->createCommand()->addColumn('{{plugins}}', 'load_error', 'int default 0');
$oDB->createCommand()->addColumn('{{plugins}}', 'load_error_message', 'text');

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

$oTransaction->commit();
}

if ($iOldDBVersion < 401) {
if ($iOldDBVersion < 402) {
$oTransaction = $oDB->beginTransaction();

// Plugin type is either "core" or "user" (different folder locations).
$oDB->createCommand()->addColumn('{{plugins}}', 'plugin_type', "string(4) default 'user'");

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

$oTransaction->commit();
}

/**
* Make tokens fit UUID 36 chars
*/
if ($iOldDBVersion < 402) {
if ($iOldDBVersion < 403) {
$oTransaction = $oDB->beginTransaction();
upgradeTokenTables402('utf8mb4_bin');
upgradeSurveyTables402('utf8mb4_bin');
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>402),"stg_name='DBVersion'");
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>403),"stg_name='DBVersion'");
$oTransaction->commit();
}

Expand Down

0 comments on commit d8ae3b7

Please sign in to comment.