Open yobottehg opened 5 days ago
Hey @yobottehg, does this happen on the latest version of beta?
Also are you able to copy your configuration in a repro we can reproduce more easily please? Our test suite automatically tests for pg and we have a lot of nested blocks.
Link to reproduction
No response
Payload Version
3.0.0-Beta51
Node Version
20 LTS
Next.js Version
15.0-rc.0
Describe the Bug
When a Collection has a block field with some available blocks and one of these blocks has an additional blocks field It's not possible to generate a migration for this field.
We have a page collection with some Blocks. The blocks field looks like this:
The
AccordionBlock
now should allow for multiple accordion items where each one has a title and can have additional content elements inside.The base fields for the accordionBlock look like this (First without the block in block feature):
This works. However when we add a blocks field inside the accordion fields we get different error messages:
1. version (It should work like this?)
yields
[08:27:02] ERROR (payload): Error: cannot connect to Postgres. Details: Cannot read properties of undefined (reading 'Symbol(drizzle:Name)')
when runningpayload migrate:create
Strange error which has nothing to do with the connection but seems like a serious issue in Drizzle?
2. version (differentiate blocks db table)
yields
[08:28:22] ERROR (payload): There were 1 errors validating your Payload config [08:28:22] ERROR (payload): 1: Collection "pages" > Field "content" > "value" does not match any of the allowed type
when runningpayload migrate:create
.If i remove the AccordionBlock from the pages collection it works again. So unsure which
value
is checked here.If i remove the
localized: true
from the field i the yielded error is:also with a different
dbName
for the accordion item.I think it would work if I would create dedicated
accordion_item_rich_text
blocks but I would like to not go that route if possible.Any hints on where to go from here would be very good!
Reproduction Steps
Please see bug description.
Adapters and Plugins
db-postgres