public void detachDDLFile(VirtualFile virtualFile) {
DBObjectRef<DBSchemaObject> objectRef = mappings.remove(virtualFile.getPath());
// map last used connection/schema
FileConnectionMappingManager connectionMappingManager = FileConnectionMappingManager.getInstance(getProject());
ConnectionHandler activeConnection = connectionMappingManager.getActiveConnection(virtualFile);
if (activeConnection == null) {
DBSchemaObject schemaObject = objectRef.get();
if (schemaObject != null) {
ConnectionHandler connectionHandler = schemaObject.getConnectionHandler();
DBSchema schema = schemaObject.getSchema();
connectionMappingManager.setActiveConnection(virtualFile, connectionHandler);
connectionMappingManager.setCurrentSchema(virtualFile, schema);
}
}