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

Fixed #27096 -- Fixed primary key introspection for sqlite3 backend

This commit is contained in:
Claude Paroz
2016-08-20 10:28:42 +02:00
parent 9f27735612
commit 00bb47b58f
3 changed files with 5 additions and 3 deletions

View File

@@ -214,7 +214,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( AUTOINCREMENT)?$', field_desc)
m = re.search('"(.*)".*PRIMARY KEY( AUTOINCREMENT)?', field_desc)
if m:
return m.groups()[0]
return None