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:
committed by
Tim Graham
parent
09da1e79de
commit
f28d29e8b7
@@ -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('"')
|
||||
|
||||
Reference in New Issue
Block a user