Enabling version.drafts on existing collection results in having no documents despite ...

default discord avatar
wiesson
6 months ago
4

Having set

return true

or



return {
  or: [
    {
      _status: {
        equals: "published",
      },
    },
    {
      _status: {
        exists: false,
      },
    },
  ],
};


If I enable it, no documents are visible. I also set

_status

manually to

published

or

draft

but I have a feeling that a relation is required in

_{collection-slug}_versions

otherwise it's not visible?

  • discord user avatar
    jesschow
    Payload Team
    6 months ago

    hi @wiesson - what version of payload are you on?

  • default discord avatar
    wiesson
    6 months ago

    Latest if I’m correct, 1.6.X 🤔

  • discord user avatar
    jesschow
    Payload Team
    6 months ago

    We had a breaking change in 1.6.1 that required migration of document versions, however if your project was created after this release you should not need to migrate.



    Here is more info and the migration script:


    https://github.com/payloadcms/payload/blob/master/CHANGELOG.md#-versions-may-need-to-be-migrate



    And if this isn't applicable, then it may be a bug if we can reproduce it

  • default discord avatar
    wiesson
    6 months ago

    Thank you! The project has been created with 0.18.5 and I'm upgrading regularly and I did run the migration script. But let me check again!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.