So I'm using the latest version of Payload with Nextjs 15 and Postgres
I would like to be able to group or ungroup fields without losing/modifying data:
Payload and/or Drizzle seems to be saving a different state for uploading images via grouped fields, and uploading images via ungrouped fields
In other words, the images that I have uploaded are not the same when I switch to group or no group:
should I be using one of these commands to resolve this?
pnpx payload migrate:create name pnpm generate:importmap
or is this more to do how Postgres works? Or does it not really matter that much with Sql/NoSql when Drizzle involved?
Unfortunately I am not experienced with database architecture to understand what is happening here. Also not sure if it's best approach to always rename tables, or to press Y for data loss and create a new table. In this case it doesn't seem to matter, similar result
ungrouped:
fields: [ { name: 'featuredImage', type: 'upload', relationTo: 'media', required: false, admin: {}, }, { name: 'exteriorImages', type: 'upload', relationTo: 'media', hasMany: true, admin: {}, }, { name: 'interiorImages', type: 'upload', relationTo: 'media', hasMany: true, admin: {}, }, ...
grouped:
`fields: [
{
name: 'images',
label: 'Images',
type: 'group',
admin: {
position: 'sidebar',
},
fields: [
{
name: 'featuredImage',
type: 'upload',
relationTo: 'media',
required: false,
admin: {},
},
{
name: 'exteriorImages',
type: 'upload',
relationTo: 'media',
hasMany: true,
admin: {},
},
{
name: 'interiorImages',
type: 'upload',
relationTo: 'media',
hasMany: true,
admin: {},
},
],
}
...,`