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

Fixed #27372 -- Fixed introspection of SQLite foreign keys with spaces in DDL.

Thanks samuller for the report and initial patch.
This commit is contained in:
Saulius Žemaitaitis
2016-11-05 13:46:59 +01:00
committed by Tim Graham
parent 09da1e79de
commit f28d29e8b7
2 changed files with 14 additions and 12 deletions

View File

@@ -132,7 +132,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
if field_desc.startswith("FOREIGN KEY"):
# Find name of the target FK field
m = re.match(r'FOREIGN KEY\(([^\)]*)\).*', field_desc, re.I)
m = re.match(r'FOREIGN KEY\s*\(([^\)]*)\).*', field_desc, re.I)
field_name = m.groups()[0].strip('"')
else:
field_name = field_desc.split()[0].strip('"')