[Bug] Database warning: (models.W042) Auto-created primary key used when not defining a primary key type
TimidRobot opened this issue · 1 comments
TimidRobot commented
Description
WARNINGS:
legal_db.Case: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the LegalDBConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
legal_db.FAQ: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the LegalDBConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
legal_db.Link: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the LegalDBConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
legal_db.Scholarship: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the LegalDBConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
Reproduction
do most any Django thing
Expectation
- Application should run without warnings
- Need to find documentation on Django migrations on Heroku
Additional context
TimidRobot commented
I expect this can be fixed by adding
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
to caselaw/settings.py
(That file could also use some clean-up: remove auto-generated messages, update URLs to Django 3.2, etc.)