Closed YagoGG closed 4 months ago
Even though it is not necessary, it might be worth tackling down #6 before this.
We could modify Top Profe to use an ORM, make sure that it works fine with the current data model (i.e. with this bug included), and then fix this bug.
By solving each issue separately, we make sure that both fixes work properly and there is a reduced chance of breaking stuff in the process.
Description
The subject database uses acronyms as the primary key. This originally made sense because at ETSIT-UPM we do not have subjects with overlapping acronyms within the same degree.
However, since we introduced multiple degrees, this no longer holds true and it causes problems. For instance, "SSIT" can be:
Impact
This results in different problems:
We can no longer filter votes by different degree.
When listing which degree does each subject belong to, these subjects with overlapping acronyms will only appear once (as there is only one entry in the database, the last one that was
UPSERT
ed).Votes cast for a specific professor in one of these "tricky" subjects might be associated with the wrong subject. For instance:
Assuming that the last imported subjects were the GIB ones, both votes will be counted towards GIB's SSIT, and nothing will appear for GITST.
Fix
Stop using the acronym as the primary key for the subject database (making the corresponding changes in the controllers so no features are broken). For instance, a regular, autoincremental primary key can be used instead of the acronym.