Open davmlaw opened 1 year ago
I followed the steps above, and it failed:
django.db.utils.NotSupportedError: nondeterministic collations are not supported for operator class "text_pattern_ops"
This has been reported and fixed, but has not been released yet (isn't in 4.2.2)
I'll disable the warnings for now...
1st we need to work out what version migrations will work on
Here are the actively updating server Django versions
Server | Django version |
---|---|
variantgrid.com | 4.2.10 |
test.variantgrid.com | 4.2.14 |
shariant.org.au | 4.2.11 |
test.shariant.org.au | 4.2.11 |
demo.shariant.org.au | 4.2.11 |
(JA: Side note, I wonder if it's worth putting the Django version as an admin only field on the versions page)
@davmlaw I've filled in the Django versions of the Shariant environments
JA: Side note, I wonder if it's worth putting the Django version as an admin only field on the versions page
Yeah I went and looked hoping it was there - spun off into mini issue SACGF/variantgrid#1129
It is fixed in 4.2 but only for new ones https://code.djangoproject.com/ticket/33901#comment:17
This fix indeed only solves the problem when you first time creating model fields with collation and prevents pattern ops index created
So - I had to do a few migrations to rename symbol to "old_symbol", make a new one, copy across, delete old, change PK
testing: should be no visible change - gene names should remain case insensitive
I searched for GaTa2 and brCa1 and ti worked as before
If you find errors like:
NotSupportedError: nondeterministic collations are not supported for LIKE
I added get_deterministic_queryset
which annotated symbol_deterministic
which you can perform likes on
https://docs.djangoproject.com/en/4.2/ref/contrib/postgres/operations/#manage-postgresql-collations
https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation/