creativecommons / legaldb

CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.

Home Page:https://LegalDB.CreativeCommons.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Database warning: (models.W042) Auto-created primary key used when not defining a primary key type

TimidRobot opened this issue · comments

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

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.)