View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
17357Bug reportsDatabase designpublic2021-07-12 11:53
Reporterrjpinto Assigned Toollehar  
PriorityhighSeveritycrash 
Status closedResolutionfixed 
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.
Bug heat6
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

Users monitoring this issue

User List There are no users monitoring this issue.

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.
ollehar

ollehar

2021-07-01 10:50

administrator   ~65176

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=32163
ollehar

ollehar

2021-07-01 10:50

administrator   ~65177

Thanks for testing!
c_schmitz

c_schmitz

2021-07-12 11:53

administrator   ~65336

Release done.

Related Changesets

LimeSurvey: master ed5dbe80

2021-07-01 10:49:50

ollehar

Details Diff
Fixed issue 17357: Database upgrade from 3.27.2 to latest 5.0.3 fails (missing default value) Affected Issues
17357
mod - application/helpers/update/updatedb_helper.php Diff File

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
2021-07-01 10:50 ollehar Changeset attached => LimeSurvey master ed5dbe80
2021-07-01 10:50 ollehar Note Added: 65176
2021-07-01 10:50 ollehar Resolution open => fixed
2021-07-01 10:50 ollehar Note Added: 65177
2021-07-01 10:50 ollehar Status assigned => resolved
2021-07-12 11:53 c_schmitz Note Added: 65336
2021-07-12 11:53 c_schmitz Status resolved => closed