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.

Team development

default discord avatar
gifgaar2 years ago
6

How can my colleague and I collaborate in the same CMS using a shared database?



When I create a new field, he gets a prompt in his terminal asking if he wants to delete my entry, as his version of the code doesn’t yet include the new field.



Our current solution is to work with multiple databases, but that feels like overkill.

  • default discord avatar
    niels89962 years ago

    Im also curious about this

  • default discord avatar
    redxne2 years ago

    I would also like to know if there is a solution to this

  • default discord avatar
    arstoien_399182 years ago

    Best practice in my experience is to use individual local DB's. And use DB migrations if data needs to be shared.


    Its too easy to corrupt a table or nuke it, losing hours of work.



    Maybe you could get away with it by practicing trunk based development - working on the same branch and pushing your schema changes as soon as you make them, but that seems like a dangerous recipe. And still requires your team to be in a position to pull those changes.

  • default discord avatar
    gifgaar2 years ago

    That could be a possible solution, but I still feel like the multiple databases are a bit overkill.



    I do understand why its happening, but its a bit of a dealbreaker

  • default discord avatar
    ritsu04552 years ago

    I just created a PR that can solve it

    https://github.com/payloadcms/payload/pull/8196

    you would have to introspect your database into a drizzle schema and pass it into

    beforeSchemaInit
  • default discord avatar
    gifgaar2 years ago

    Thanks

    @423216344302092288

    , gonna try it out when it's merged!

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.