Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Possible failure on upgrade due to missing survey_links table
- Loading branch information
1 parent
11e2b61
commit c9e9c98
Showing
1 changed file
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ function db_upgrade_all($oldversion) { | |
Yii::app()->db->createCommand()->alterColumn('{{saved_control}}','email',"{$sVarchar}(320) NOT NULL"); | ||
Yii::app()->db->createCommand()->alterColumn('{{surveys}}','adminemail',"{$sVarchar}(320) NOT NULL"); | ||
Yii::app()->db->createCommand()->alterColumn('{{users}}','email',"{$sVarchar}(320) NOT NULL"); | ||
Yii::app()->db->createCommand()->insert('{{settings_global}}',array('stg_name'=>'SessionName','stg_value'=>randomChars(64,'ABCDEFGHIJKLMNOPQRSTUVWXYZ!"§$%&/()=?´`+*~#",;.:abcdefghijklmnopqrstuvwxyz123456789'))); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Shnoulle
Collaborator
|
||
Yii::app()->db->createCommand()->insert('{{settings_global}}',array('stg_name'=>'SessionName','stg_value'=>randomChars(64,'ABCDEFGHIJKLMNOPQRSTUVWXYZ!"�$%&/()=?�`+*~#",;.:abcdefghijklmnopqrstuvwxyz123456789'))); | ||
Yii::app()->db->createCommand()->update('{{settings_global}}',array('stg_value'=>114),"stg_name='DBVersion'"); | ||
} | ||
|
||
|
@@ -914,6 +914,18 @@ function db_upgrade_all($oldversion) { | |
alterColumn('{{survey_permissions}}','sid','integer',false); | ||
alterColumn('{{survey_permissions}}','uid','integer',false); | ||
alterColumn('{{users}}','htmleditormode',"{$sVarchar}(7)",true,'default'); | ||
|
||
// Sometimes the survey_links table was deleted before this step, if so | ||
// we recreate it (copied from line 663) | ||
if (!tableExists('{survey_links}')) { | ||
createTable('{{survey_links}}',array( | ||
'participant_id' => $sVarchar.'(50) NOT NULL', | ||
'token_id' => 'integer NOT NULL', | ||
'survey_id' => 'integer NOT NULL', | ||
'date_created' => 'datetime NOT NULL' | ||
)); | ||
addPrimaryKey('survey_links', array('participant_id','token_id','survey_id')); | ||
} | ||
alterColumn('{{survey_links}}','date_created',"datetime",true); | ||
alterColumn('{{saved_control}}','identifier',"text",false); | ||
alterColumn('{{saved_control}}','email',"{$sVarchar}(320)"); | ||
|
Didn't see this but got warning on not safe utf-8 opening of the file. Maybe the first ans last char should be removed?