benjiman86
benjiman86
DTDrizzle Team
Created by benjiman86 on 6/6/2023 in #help
Share migrations in monorepo
I am using drizzle in a monorepo (npm workspaces with turborepo) within an internal package that is shared among multiple apps. It basically exports a bunch of functions that use drizzle behind the scenes. This works great, however I can't run migrations from within the apps that use the package, because the folder with the migrations is only available inside the package that contains drizzle. I would love to run the migrations on app startup using migrate from drizzle-orm/postgres-js/migrator like shown in the examples, but then I get the error that the migrations can't be found. The only solution I figured so far is to copy the migrations from the shared package to every app directory every time when I ran drizzle-kit generate. Can you think of any better solutions?
13 replies