﻿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
34436	`makemigrations --check` fails with error code 1 if system checks identify warnings	James Addison	nobody	"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."	Bug	closed	Migrations	4.2	Normal	invalid			Unreviewed	0	0	0	0	0	0
