View Issue Details

IDProjectCategoryView StatusLast Update
17357Bug reportsDatabase designpublic2021-06-10 22:45
Reporterrjpinto Assigned Toollehar  
PriorityhighSeveritycrash 
Status assignedResolutionopen 
Product Version5.x 
Summary17357: Database upgrade from 3.27.2 to latest 5.0.3 fails
DescriptionThe database upgrade from the latest stable version to the new 5.x version fails because when adding the column all rows of that column are null which is not allowed by the DDL

Current database version: 365
Target database version: 449

An non-recoverable error happened during the update. Error details:

CDbCommand failed to execute the SQL statement: SQLSTATE[23502]: Not null violation: 7 ERROR: column "encrypted" contains null values

File updatedb_helper.php, line 3322.


line 3322 of the database upgrade script:
createCommand()->addColumn('{{participant_attribute_names}}', 'encrypted', "string(5) NOT NULL");
Steps To ReproduceIn a working limesurvey system deploy the latest 5.x version and copied the config.php. Login to start the database upgrade and it will fail.
TagsNo tags attached.
Complete LimeSurvey version number (& build)3.27.2
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionPostgresql 12 with DB version 365
Server OS (if known)Ubuntu 20.04 LTS
Webserver software & version (if known)Apache
PHP Version7.4

Activities

ollehar

ollehar

2021-06-08 20:44

administrator   ~64785

Lacking default value?
ollehar

ollehar

2021-06-08 20:47

administrator   ~64786

$oDB->createCommand()->addColumn('{{participant_attribute_names}}', 'encrypted', "string(5) NOT NULL DEFAULT 'N'");
            $oDB->createCommand()->addColumn('{{participant_attribute_names}}', 'core_attribute', "string(5) NOT NULL DEFAULT 'N'");

Can you try to apply these changes and try again?
ollehar

ollehar

2021-06-08 20:48

administrator   ~64787

Might be similar problems later in the file, I see.
rjpinto

rjpinto

2021-06-10 22:45

reporter   ~64868

Adding a default value to the column fixes the update to version 5. Just tested after changing the lines you mentioned and the upgrade is successful.

Issue History

Date Modified Username Field Change
2021-06-08 20:02 rjpinto New Issue
2021-06-08 20:43 ollehar Priority none => high
2021-06-08 20:44 ollehar Note Added: 64785
2021-06-08 20:47 ollehar Note Added: 64786
2021-06-08 20:48 ollehar Note Added: 64787
2021-06-08 20:48 ollehar Assigned To => ollehar
2021-06-08 20:48 ollehar Status new => feedback
2021-06-10 22:45 rjpinto Note Added: 64868
2021-06-10 22:45 rjpinto Status feedback => assigned