File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -127,16 +127,18 @@ def deserialize_db_from_string(self, data):
127
127
the serialize_db_to_string() method.
128
128
"""
129
129
data = StringIO (data )
130
+ table_names = set ()
130
131
# Load data in a transaction to handle forward references and cycles.
131
132
with atomic (using = self .connection .alias ):
132
133
# Disable constraint checks, because some databases (MySQL) doesn't
133
134
# support deferred checks.
134
135
with self .connection .constraint_checks_disabled ():
135
136
for obj in serializers .deserialize ('json' , data , using = self .connection .alias ):
136
137
obj .save ()
138
+ table_names .add (obj .object .__class__ ._meta .db_table )
137
139
# Manually check for any invalid keys that might have been added,
138
140
# because constraint checks were disabled.
139
- self .connection .check_constraints ()
141
+ self .connection .check_constraints (table_names = table_names )
140
142
141
143
def _get_database_display_str (self , verbosity , database_name ):
142
144
"""
You can’t perform that action at this time.
0 commit comments