Skip to content

Primary key must now be explicit #35

@lifenautjoe

Description

@lifenautjoe

In latest django versions a warning is emitted when models do not explicitly define a primary key.

(somus-api) ~/Documents/code/somus/somus-api(hotfix/video-encoding-update ✗) python manage.py runserver
2021-10-15 23:16:56,588 django.utils.autoreload INFO     Watching for file changes with StatReloader
Performing system checks...

System check identified some issues:

WARNINGS:
video_encoding.Format: (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 AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

I'll come back with a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions