From 0644d72d0426439141bcc646dc8e5a367190cb0f Mon Sep 17 00:00:00 2001 From: Tyndie Date: Fri, 2 Dec 2016 14:32:05 +0000 Subject: [PATCH] Bugfix for incorrect Django introspection type. - Remove extra encapsulation from get_constraints for foreign key parameter which is stored as a constraint properties due to a incorrect detection type from a unique key as a foreign key when altering a OneToOneField in a Django migration. --- lib/mysql/connector/django/introspection.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/mysql/connector/django/introspection.py b/lib/mysql/connector/django/introspection.py index 77e5503..ee3999a 100644 --- a/lib/mysql/connector/django/introspection.py +++ b/lib/mysql/connector/django/introspection.py @@ -279,9 +279,7 @@ def get_constraints(self, cursor, table_name): 'unique': False, 'index': False, 'check': False, - 'foreign_key': ( - (ref_table, ref_column) if ref_column else None, - ) + 'foreign_key': (ref_table, ref_column) if ref_column else None, } constraints[constraint]['columns'].add(column) # Now get the constraint types