Hey everyone! Have been playing around with migrat...
# orm-help
s
Hey everyone! Have been playing around with migrating github.com/medusajs/medusa from TypeORM to Prisma, but not sure how to approach it given the architecture we have. Will try to explain in a few steps here: • We have a core NPM package that contains core db entities • We have multiple plugins that may or may not include additional db entities • Users of the Medusa install the core package + any plugins that they may want • On bootstrap the core package collects all db entities + all migrations across core and plugins •
medusa migrations run
will ensure that all missing migrations from core + plugins are applied Trying to map this to Prisma my thinking so far is this: • Core + Plugins will have
schema.prisma
• Core + Plugins will have migrations • *Core will programmatically collect migrations and call Prisma Migrate • *Core programatically creates a Prisma client that is unique to the user’s core + plugins combination My questions are about the last two steps marked with * - 1) are these steps possible and recommended and 2) are there alternative approaches that would be better