Ensure crsid field is always lower cased
Part of #14 (closed)
Changes the field for the CRSId primary key on the Account model to use a new field that enforces lower-caseness for the CRSId in the database, and when comparing CRSIds.
Collation Vs. Field
The alternative to this would be to add a db_collation
to the CRSId field, which I investigated and would also work for comparisons. The advantage of the overriden Field
in this case is that it ensures that the CRSId is saved into the database as lowercase, rather than just matching insensitively. This means (for example) when we serialise the Account to return from the API the CRSId is always consistently returned as lowercase.
Edited by Mike Knee