Skip to content

Commit

Permalink
Fixed issue #16788: Column 'expire' in lime_sessions has no index
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 5, 2021
1 parent 1318758 commit 1d9c951
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -12,7 +12,7 @@
*/

$config['versionnumber'] = '4.4.11';
$config['dbversionnumber'] = 439;
$config['dbversionnumber'] = 440;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
Expand Down
7 changes: 7 additions & 0 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -3714,6 +3714,13 @@ function ($v) {
$oTransaction->commit();
}

if ($iOldDBVersion < 440) {
$oTransaction = $oDB->beginTransaction();
$oDB->createCommand()->createIndex('sess_expire', '{{sessions}}', 'expire');
$oDB->createCommand()->update('{{settings_global}}', ['stg_value' => 440], "stg_name='DBVersion'");
$oTransaction->commit();
}

} catch (Exception $e) {
Yii::app()->setConfig('Updating', false);
$oTransaction->rollback();
Expand Down
3 changes: 1 addition & 2 deletions installer/create-database.php
Expand Up @@ -475,9 +475,8 @@ function populateDatabase($oDB)
'expire' => "integer NULL",
'data' => "longbinary",
), $options);

$oDB->createCommand()->addPrimaryKey('{{sessions_pk}}', '{{sessions}}', 'id');

$oDB->createCommand()->createIndex('sess_expire', '{{sessions}}', 'expire');

// settings_global

Expand Down

0 comments on commit 1d9c951

Please sign in to comment.