summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorVajrasky Kok <sky.kok@speaklikeaking.com>2013-11-24 21:12:22 +0800
committerTim Graham <timograham@gmail.com>2014-02-06 05:16:40 -0500
commitd3cf6cfacfb828faad4f4f97c904e259304649b3 (patch)
treeae44bc63cc45a144edbec26bb5590b8225e70233 /django/db
parentb22d6c47a7e4c7ab26a8b7b033d11fa6743aae86 (diff)
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.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/backends/__init__.py4
-rw-r--r--django/db/backends/mysql/base.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 50b8745f47..59db3220fd 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -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
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index b752f4738f..d35d7a3888 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -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