def METHOD_NAME(
    db: orm.Session,
    tool: models.DatabaseTool,
    patch_tool: models.PatchToolDockerimage,
) -> models.DatabaseTool:
    if patch_tool.persistent:
        tool.docker_image_template = patch_tool.persistent
    if patch_tool.readonly:
        tool.readonly_docker_image_template = patch_tool.readonly
    if patch_tool.backup:
        tool.docker_image_backup_template = patch_tool.backup
    db.commit()
    return tool