1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #17713 -- Renamed BaseDatabaseFeatures.allows_primary_key_0 to allows_auto_pk_0.

MySQL does allow primary key with value 0. It only forbids autoincrement
primary key with value 0.

Thanks Claude Paroz for the report.
This commit is contained in:
Vajrasky Kok
2013-11-24 21:12:22 +08:00
committed by Tim Graham
parent b22d6c47a7
commit d3cf6cfacf
7 changed files with 16 additions and 12 deletions

View File

@@ -613,8 +613,8 @@ class BaseDatabaseFeatures(object):
# Is there a 1000 item limit on query parameters?
supports_1000_query_parameters = True
# Can an object have a primary key of 0? MySQL says No.
allows_primary_key_0 = True
# Can an object have an autoincrement primary key of 0? MySQL says No.
allows_auto_pk_0 = True
# Do we need to NULL a ForeignKey out, or can the constraint check be
# deferred

View File

@@ -177,7 +177,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_date_lookup_using_string = False
supports_timezones = False
requires_explicit_null_ordering_when_grouping = True
allows_primary_key_0 = False
allows_auto_pk_0 = False
uses_savepoints = True
atomic_transactions = False
supports_check_constraints = False