#34436: `makemigrations --check` fails with error code 1 if system checks 
identify
warnings
-----------------------------------------+------------------------
               Reporter:  James Addison  |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Migrations     |        Version:  4.2
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 In working through the upgrade steps from a Django 3.2 based system to
 Django 4.2, I encountered behaviour that breaks our github actions
 continuous integration (it is intended to fail if there are missing
 migrations needed).

 In this case, there are no missing migration files identified, but the
 `./venv/bin/python manage.py makemigrations --check` command errors out
 with `1`, presumably due to CICharField W905 and CITextField W907
 warnings:

 {{{
 # ./venv/bin/python manage.py makemigrations --check
 System check identified some issues:

 WARNINGS:
 accounts.ComplianceRegion.name: (fields.W905)
 django.contrib.postgres.fields.CICharField is deprecated. Support for it
 (except in historical migrations) will be removed in Django 5.1.
         HINT: Use CharField(db_collation="…") with a case-insensitive non-
 deterministic collation instead.
 accounts.ComplianceRegion.sub_region: (fields.W905)
 django.contrib.postgres.fields.CICharField is deprecated. Support for it
 (except in historical migrations) will be removed in Django 5.1.
         HINT: Use CharField(db_collation="…") with a case-insensitive non-
 deterministic collation instead.
 information.Degree.degree: (fields.W907)
 django.contrib.postgres.fields.CITextField is deprecated. Support for it
 (except in historical migrations) will be removed in Django 5.1.
         HINT: Use TextField(db_collation="…") with a case-insensitive non-
 deterministic collation instead.

 System check identified 3 issues (5 silenced).

 # echo $?
 1


 # /venv/bin/python manage.py check
 System check identified some issues:

 WARNINGS:
 accounts.ComplianceRegion.name: (fields.W905)
 django.contrib.postgres.fields.CICharField is deprecated. Support for it
 (except in historical migrations) will be removed in Django 5.1.
         HINT: Use CharField(db_collation="…") with a case-insensitive non-
 deterministic collation instead.
 accounts.ComplianceRegion.sub_region: (fields.W905)
 django.contrib.postgres.fields.CICharField is deprecated. Support for it
 (except in historical migrations) will be removed in Django 5.1.
         HINT: Use CharField(db_collation="…") with a case-insensitive non-
 deterministic collation instead.
 information.Degree.degree: (fields.W907)
 django.contrib.postgres.fields.CITextField is deprecated. Support for it
 (except in historical migrations) will be removed in Django 5.1.
         HINT: Use TextField(db_collation="…") with a case-insensitive non-
 deterministic collation instead.

 System check identified 3 issues (5 silenced).

 # echo $?
 0
 }}}

 Note that both `manage.py makemigrations --check` and `manage.py check`
 are provided above for clarity.

 These are deprecation warnings (to be removed in Django 5.1). I think this
 management command should not be erroring out in relation to these at this
 point in time.

 I personally have time to address these CITextField and CICharField
 warnings properly by moving to the preferred `db_collation=...` collation
 approach, but wanted to raise this as a bug.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34436>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018714724b10-7b6b941e-b507-4074-a66a-3c7da5ab7172-000000%40eu-central-1.amazonses.com.

Reply via email to