mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #16008
[Bug 1262932] Re: Bad data in the DB can cause the schema correction SQL to throw a fatal error
https://reviews.mahara.org/#/c/2833/
** Changed in: mahara
Status: New => In Progress
** Changed in: mahara
Importance: Undecided => Medium
** Changed in: mahara
Assignee: (unassigned) => Aaron Wells (u-aaronw)
** Changed in: mahara
Milestone: None => 1.9.0
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1262932
Title:
Bad data in the DB can cause the schema correction SQL to throw a
fatal error
Status in Mahara ePortfolio:
In Progress
Bug description:
Looking at this forum post
https://mahara.org/interaction/forum/topic.php?id=5986&offset=0&limit=10
...
It occurs to me that there's a problem in our schema correction code.
We're adding foreign keys to existing tables, but we didn't first
check to see whether the tables have data that will fit that foreign
key. If they have bad data, then this upgrade script will error out
and prevent them from upgrading. And since these missing schema
elements are not vital, we don't want their failure to block upgrade.
We should have put a "catch (SQLException $e)" block around each
attempt to add a foreign key, unique index, and/or primary key, or
another other schema element that will fail if their data isn't clean.
:-P
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1262932/+subscriptions
References