Upgrade error null value in column "numcolumns" violates not-null constraint

Bug #1558854 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

We recently removed the numcolumns column from views as it is obsolete

But we get an error when upgrading from older versions of Mahara, eg 15.04 as the upgrade script wants to create a new view before the numcolumns column is removed form db but doesn't have a default value for it in lib/view.php

For example, we get this error:

Failed to get a recordset: postgres8 error: [-1: ERROR: null value in column "numcolumns" violates not-null constraint]

From calling the function install_system_portfolio_view() at htdocs/lib/db/upgrade.php line 4182

I'll add back in the default value for numcolumns into the lib/view.php file so that things will save correctly before the column is removed from db during upgrade.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/6172

Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6172
Committed: https://git.mahara.org/mahara/mahara/commit/f3c35536c29a9bd7e85c474aa012d43924017937
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit f3c35536c29a9bd7e85c474aa012d43924017937
Author: Robert Lyon <email address hidden>
Date: Fri Mar 18 13:10:04 2016 +1300

Bug 1558854: Need to allow default numcolumns in lib/view.php

When we upgrade from earlier versions views need to be saved that
expect the numcolumns field to exist before we get round to dropping
it. So the View class needs to be able to define a default value for
it.

behatnotneeded - unable to test upgrades

Change-Id: Ic70add18e814975289a7145e8e91454e3699a234
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.