Requested Change to the prereq_skill field in altadv_vars table
Well, after failing to properly add some new AAs and accidentally breaking many AAs so they couldn't be trained due to Requirement issues, I finally figured out how the prereq_skill field works in the altadv_vars table. The problem with it is that currently if you add any AAs to that table, you have to update every AA that uses a requirement higher than the line number that the AA you added is in.
AAs are ordered by the skill_id field. And, the prereq_skill field actually uses the line number in the table, not any actual field data from the table. So, if you add an AA with skill_id of 225 and it actually goes in at line 100 in the table, then in order to set another AA to require that one, you must set the prereq_skill field to 100 in the AA you want to require the one you added before.
The problem with this is that there are no line number in the table, so to find out what to set the prereq_skill field to, you have to COUNT each row until you get to the one you want it to require and that is the number.
An even worse problem with this system is that if you add any new AAs in the table, it will bump the line numbers on any AAs that come after it, which throws off the prereq_skill field for anything requiring an AA higher than the one you added. This means that anytime you add an AA, you have to increment all prereq_skills higher than the one you added by 1 for them to align properly again.
If possible, I propose a change to this system. Either add in an incrementing ID number field that gets added to for each new AA, or probably the best solution is to set the prereq_skill field to look for the skill_id instead of the line number.
|