1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #10164 -- Made AutoField increase monotonically on SQLite

Thanks malte for the report.
This commit is contained in:
Chris Wilson
2013-09-06 12:18:16 -04:00
committed by Tim Graham
parent 630eb0564a
commit eade315da1
7 changed files with 40 additions and 1 deletions

View File

@@ -175,7 +175,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
results = results[results.index('(') + 1:results.rindex(')')]
for field_desc in results.split(','):
field_desc = field_desc.strip()
m = re.search('"(.*)".*PRIMARY KEY$', field_desc)
m = re.search('"(.*)".*PRIMARY KEY( AUTOINCREMENT)?$', field_desc)
if m:
return m.groups()[0]
return None