Skip to content

Identifier fields should always be case sensitive #16

Closed

Description

@ormsbee

Identifier fields (strings that are local to some context, like usage keys) should be case-sensitive. Right now, it will or won't be depending on the default collation and the database in question. This will lead to conflicting behavior between SQLite (case-sensitive) and MySQL (case-insensitive). Using the db_collation attribute is tempting, but these values are not standardized across databases, which would complicate things when using SQLite vs. MySQL even in day to day dev and testing (never mind the possibility of Postgres).

Investigate what it would take to make a field type that know how to run migrations to set the collation of a field based on the database and database collation settings (so utf8mb4 would map to utf8mb4_bin, but utf8 maps to utf8_bin).

Activity

  1. ormsbee commented on Aug 2, 2022

    @ormsbee
    ContributorAuthor

    Actually, it might be better for the collation to be case-and-accent-sensitive text collation rather than straight binary, since we might want to group upper and lower case letters next to each other in listings where the identifiers are semi-human-readable.

  2. ormsbee commented on Jan 3, 2024

    @ormsbee
    ContributorAuthor

    This was addressed by creating the collation-aware MultiCollationCharField and MultiCollationTextField along with their underlying collations,py module.

  3. added a commit that references this issue on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions