Best practice forum (Archived)

Mdl_Pos_Assignment Table Data in version 9?

 
John Unnever
Mdl_Pos_Assignment Table Data in version 9?
by John Unnever - Thursday, 26 January 2017, 7:17 AM
Group Partners

Hello!  We have some custom code developed that relies on some data that used to be in the mdl_pos_assignment table in version 2.9.   I upgraded my local development copy to version 9.2.2 yesterday to begin testing and noticed my code was broke.  It appears that the mdl_pos_assignment and mdl_pos_assignment_history tables are either gone in the new version or something happened with my upgrade?   If the data has been moved elsewhere, can anyone point me to where it may of gone ?

me
Re: Mdl_Pos_Assignment Table Data in version 9?
by George Angus - Thursday, 26 January 2017, 11:31 AM
Group Totara

Hi John,

Im pretty sure it will be the multiple jobs functionality which is causing your customisation to fail. Its explained in the changelogs here

regards,

George.

Nathan Lewis
Re: Mdl_Pos_Assignment Table Data in version 9?
by Nathan Lewis - Thursday, 26 January 2017, 1:07 PM
Group Totara

Hi John.

These tables were removed as part of the job assignments feature. In the changelog, it's TL-8945, but if you want to check the patch then it is TL-2082 (I'm not sure how we mixed that up). It's actually named wrong in the changelog - look for a mention of the "position_assignment" table. And there's no mention of the history table - it was not in use so was deleted. I'll put in a patch to fix the changelog (will show up in Totara 9.4).

The easiest way to see what happened is to look at totara/core/db/upgradelib.php, lines 417 to 627, titled "Part 2", "Part 3" and "Part 4".

In Part 2, pos_assignment 'aspirational' records are moved into the 'gap_aspirational' table.

In Part 3, pos_assignment primary and secondary records are moved into job_assignment (the pos_assignment table is actually renamed and columns/indexes are added/removed/renamed, so record IDs will be unchanged).

In Part 4, the history table is deleted because it is unused, although we skip deletion if there are any records in it, in case it is being used in a customisation.

Nathan