fix issue with is_in_memory_db

For mysql, it seems `is_in_memory_db` does not even exist. Ensure it
exists before calling it.
This commit is contained in:
Robert Raposa
2020-04-28 13:49:23 -04:00
parent be1aaa00ff
commit b74acce64c

View File

@@ -15,7 +15,7 @@ class CsmBigInt(AlterField):
level and the coursewarehistoryextended_studentmodulehistoryextended table is in a different database
'''
def database_forwards(self, app_label, schema_editor, from_state, to_state):
if schema_editor.connection.is_in_memory_db():
if hasattr(schema_editor.connection, 'is_in_memory_db') and schema_editor.connection.is_in_memory_db():
# sqlite3 doesn't support 'MODIFY', so skipping during tests
return
to_model = to_state.apps.get_model(app_label, self.model_name)