def METHOD_NAME(config):
    """Merge DB config back into storage config"""
    config.setdefault("storage", orion.core.config.storage.to_dict())
    if "database" in config:
        log.debug("Updating db config for backward compatibility")
        config["storage"] = {"type": "legacy"}
        config["storage"]["database"] = config.pop("database")
        log.debug(pprint.pformat(config["storage"]))