﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33901	non-deterministic collations doesn't work with Unique=True on Postgres13.3	Ed Chai	Ed Chai	" Creating a non-deterministic collation used for case insensitive fields to replace the old approach, [https://docs.djangoproject.com/en/4.0/ref/contrib/postgres/fields/#citext-fields CIText], would raise `django.db.utils.NotSupportedError: nondeterministic collations are not supported for operator class ""varchar_pattern_ops""` when the `unique=True` is also set on the field.Since unique implies the creation of an index despite setting `db_index=False` explicitly.
here is a sample code to reproduce:
{{{
#!python
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        CreateCollation(
            'ci',
            provider='icu',
            locale='und-u-ks-level2',
            deterministic=False
        ),
        migrations.CreateModel(
            name='TestgUser',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('username', models.CharField(db_collation='ci', max_length=30, unique=True, verbose_name='username')),
            ],
            options={
                'verbose_name': 'Test User',
                'verbose_name_plural': 'Test Users',
                'abstract': False,
            },
        ),
    ]
}}}
"	Bug	closed	Migrations	dev	Normal	fixed	collation unique citext		Ready for checkin	1	0	0	0	0	0
