codepod icon indicating copy to clipboard operation
codepod copied to clipboard

Can't delete repo with edge

Open hcsum opened this issue 2 years ago • 0 comments

Deleting a repo with edge from repo list page will throw error

2023-07-03 06 56 08

{
    "errors": [
        {
            "message": "\nInvalid `prisma.pod.deleteMany()` invocation in\n/app/src/resolver_repo.ts:307:20\n\n  304 });\n  305 if (!repo) throw new Error(\"Repo not found\");\n  306 // 1. delete all pods\n→ 307 await prisma.pod.deleteMany(\nForeign key constraint failed on the field: `Edge_sourceId_fkey (index)`",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "deleteRepo"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "exception": {
                    "code": "P2003",
                    "clientVersion": "4.3.1",
                    "meta": {
                        "field_name": "Edge_sourceId_fkey (index)"
                    },
                    "stacktrace": [
                        "Error: ",
                        "Invalid `prisma.pod.deleteMany()` invocation in",
                        "/app/src/resolver_repo.ts:307:20",
                        "",
                        "  304 });",
                        "  305 if (!repo) throw new Error(\"Repo not found\");",
                        "  306 // 1. delete all pods",
                        "→ 307 await prisma.pod.deleteMany(",
                        "Foreign key constraint failed on the field: `Edge_sourceId_fkey (index)`",
                        "    at RequestHandler.handleRequestError (/app/node_modules/@prisma/client/runtime/index.js:29909:13)",
                        "    at RequestHandler.request (/app/node_modules/@prisma/client/runtime/index.js:29892:12)",
                        "    at PrismaClient._request (/app/node_modules/@prisma/client/runtime/index.js:30864:16)",
                        "    at Object.deleteRepo (/app/src/resolver_repo.ts:307:3)"
                    ]
                }
            }
        }
    ],
    "data": {
        "deleteRepo": null
    }
}

hcsum avatar Jul 02 '23 22:07 hcsum