Skip to content

Commit

Permalink
Fixed issue #09540: Call to undefined function setsDBDriverName when …
Browse files Browse the repository at this point in the history
…managing token attribute

Dev: Quick fix, install create the issue (array primaryKey)
  • Loading branch information
Shnoulle committed Mar 31, 2015
1 parent 5bb72b3 commit a629470
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions application/models/ParticipantAttributeName.php
Expand Up @@ -46,14 +46,13 @@ public static function model($class = __CLASS__) {
// Fix the primary key, needed for PgSQL http://bugs.limesurvey.org/view.php?id=6707
// First load the helper
Yii::app()->loadHelper('update/updatedb');
$dbType = setsDBDriverName();
$table = 'participant_attribute_names';
$dbType = Yii::app()->db->driverName;
if ($dbType == 'mysql') {
// Only for mysql first remove auto increment
alterColumn($model->tableName(), $model->primaryKey(), $model->tableSchema->getColumn($model->primaryKey())->dbType, false);
}
dropPrimaryKey($table);
addPrimaryKey($table, (array) $model->primaryKey());
dropPrimaryKey('participant_attribute_names');// dropPrimaryKey add the prefix (not other ...)
addPrimaryKey($model->tableName(), (array) $model->primaryKey());
if ($dbType == 'mysql') {
// Add back auto increment
alterColumn($model->tableName(), $model->primaryKey(), 'autoincrement');
Expand Down

0 comments on commit a629470

Please sign in to comment.