Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Error: There is not enough information to infer relation' with PostgresAdapter #9694

Open
Asterohobit opened this issue Dec 3, 2024 · 0 comments
Labels
stale status: needs-triage Possible bug which hasn't been reproduced yet v2

Comments

@Asterohobit
Copy link

Asterohobit commented Dec 3, 2024

Link to reproduction

No response

Describe the Bug

With nested blocks, Postgres/Drizzle cannot create implicit tables. For example, my collection GlobalElements (elements that are the same for all pages) holds a Block called FooterBlock, which can contain a FooterLinksBlock. When trying to access the collection GlobalElements via the Admin Panel, an Error is thrown:
ERROR (payload): Error: There is not enough information to infer relation "global_elements._blocks_footerLinksBlock"

Have you encountered this error before? A quick internet search suggested is has to do with defining relations one-sided, but this is not the case here as everything happens implicitly.

To Reproduce

  1. Create a collection with a field like this: { name: "footer", type: "blocks", required: true, blocks: [FooterBlock], },
  2. Create the FooterBlock that contains a field like this: { name: "content", type: "blocks", blocks: [FooterLinksBlock, GridBlock], required: true, },
  3. Access the collection via the Admin Panel, the error is thrown in the local terminal.

Payload Version

2.0.0

Adapters and Plugins

db-postgres

@Asterohobit Asterohobit added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Dec 3, 2024
@github-actions github-actions bot added the stale label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale status: needs-triage Possible bug which hasn't been reproduced yet v2
Projects
None yet
Development

No branches or pull requests

1 participant