Skip to content

Commit

Permalink
Fixed issue #CR-1392: SQL not compatible with MSSQL and Postgres (#3700)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohabmes committed Jan 16, 2024
1 parent bb0854a commit 356f60b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -12,7 +12,7 @@
*/

$config['versionnumber'] = '6.4.2';
$config['dbversionnumber'] = 620;
$config['dbversionnumber'] = 621;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
Expand Down
19 changes: 19 additions & 0 deletions application/helpers/update/updates/Update_621.php
@@ -0,0 +1,19 @@
<?php

namespace LimeSurvey\Helpers\Update;

use LimeSurvey\Helpers\Update\DatabaseUpdateBase;

class Update_621 extends DatabaseUpdateBase
{
/**
* @inheritDoc
*/
public function up()
{
$table = \Yii::app()->db->schema->getTable('{{users}}');
if (isset($table->columns['user_status']) && $table->columns['user_status']->dbType != 'integer') {
\alterColumn('{{users}}', 'user_status', "integer", false, 1);
}
}
}
2 changes: 1 addition & 1 deletion installer/create-database.php
Expand Up @@ -1098,7 +1098,7 @@ function populateDatabase($oDB)
'validation_key_expiration' => 'datetime',
'last_forgot_email_password' => 'datetime',
'expires' => 'datetime',
'user_status' => 'BOOLEAN DEFAULT TRUE'
'user_status' => 'integer NOT NULL DEFAULT 1'
), $options);

$oDB->createCommand()->createIndex('{{idx1_users}}', '{{users}}', 'users_name', true);
Expand Down

0 comments on commit 356f60b

Please sign in to comment.