From d9652401e4a59b0c972cef47a5583692fd2a3482 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Mon, 15 Jan 2024 14:39:39 +0100 Subject: [PATCH] Explicit default_auto_field. This is configurable since Django 3.2, which is already the required version for oscar-api. see: https://docs.djangoproject.com/en/3.2/topics/db/models/#automatic-primary-key-fields Explicitly telling which field to use if good, it avoids a supious migration like: $ ./manage.py makemigrations Migrations for 'oscarapi': /home/mdk/src/django-oscar/.venv/lib/python3.11/site-packages/oscarapi/migrations/0002_alter_apikey_id.py - Alter field id on apikey notice the migration is created in the venv, in oscarapi tree, not in the user project, it won't work anyway. --- oscarapi/apps.py | 1 + 1 file changed, 1 insertion(+) diff --git a/oscarapi/apps.py b/oscarapi/apps.py index 63a59051..e40e798e 100644 --- a/oscarapi/apps.py +++ b/oscarapi/apps.py @@ -3,3 +3,4 @@ class OscarAPIConfig(AppConfig): name = "oscarapi" + default_auto_field = "django.db.models.AutoField"