Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
wiesson2 years 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?

  • default discord avatar
    jessrynkar2 years ago

    hi

    @525819893333884938

    - what version of payload are you on?

  • default discord avatar
    wiesson2 years ago

    Latest if I’m correct, 1.6.X 🤔

  • default discord avatar
    jessrynkar2 years 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
    wiesson2 years 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!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.