1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #31007 -- Allowed specifying type of auto-created primary keys.

This also changes the default type of auto-created primary keys
for new apps and projects to BigAutoField.
This commit is contained in:
Tom Forbes
2020-07-12 13:59:57 +01:00
committed by Mariusz Felisiak
parent b960e4ed72
commit b5e12d490a
28 changed files with 415 additions and 11 deletions

View File

@@ -0,0 +1,25 @@
from django.apps import AppConfig
class ModelDefaultPKConfig(AppConfig):
name = 'model_options'
class ModelPKConfig(AppConfig):
name = 'model_options'
default_auto_field = 'django.db.models.SmallAutoField'
class ModelPKNonAutoConfig(AppConfig):
name = 'model_options'
default_auto_field = 'django.db.models.TextField'
class ModelPKNoneConfig(AppConfig):
name = 'model_options'
default_auto_field = None
class ModelPKNonexistentConfig(AppConfig):
name = 'model_options'
default_auto_field = 'django.db.models.NonexistentAutoField'