node.jscontent-management-systemprismakeystonejskeystonejs6

Generate KeyStone.js 6 schema from modified Prisma schema


I had a project that was using the latest version of Prisma (3.9.1) and was planning to place a CMS on top of it. Keystone seemed like a very good fit as they already use Prisma internally. Unfortunately I couldn't modify the Prisma schema because it was auto-generated from the Keystone schema. Is there a way to reverse the process and get a Keystone schema from Prisma ?


Solution

  • At the moment there's no way to generate a Keystone schema from an existing Prisma schema. You'd need to create the Keystone schema manually so Keystone could generate a new Prisma schema file.

    There's also currently no way to modify the Prisma schema generated by Keystone, though there's been talk of opening this up.