How do you run `primsa` commands in a `create-t3-turbo` monorepo?

I can run pnpm db-push but I would like to run other commands, like prisma migrate. I can't figure out how to do this
5 Replies
Dale
Dale17mo ago
Ahh never mind, you just need to cd to the prisma folder to run commands like npx prisma studio, etc Wait, that causes errors though because of the environment variables? e.g.
> npx prisma migrate dev
Prisma schema loaded from schema.prisma
Error: Prisma schema validation - (get-config wasm)
Error code: P1012
error: Environment variable not found: DATABASE_URL.
--> schema.prisma:10
|
9 | provider = "postgresql"
10 | url = env("DATABASE_URL")
|

Validation Error Count: 1
> npx prisma migrate dev
Prisma schema loaded from schema.prisma
Error: Prisma schema validation - (get-config wasm)
Error code: P1012
error: Environment variable not found: DATABASE_URL.
--> schema.prisma:10
|
9 | provider = "postgresql"
10 | url = env("DATABASE_URL")
|

Validation Error Count: 1
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Dale
Dale17mo ago
I have a different DATABASE_URL that is connected to a postegres database on supabase.. is that wrong?
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Dale
Dale17mo ago
No I am still confused. My .env file already has a DATABASE_URL connection to a supabase hosted postgres database e.g.
DATABASE_URL='postgres://postgres:{password}@db.{string}.supabase.co:6543/postgres'
DATABASE_URL='postgres://postgres:{password}@db.{string}.supabase.co:6543/postgres'
Wouldn't adding a local host overwrite that? Also, how would this allow me to run a npx prisma studio command from the root dir? Ahh it seems like it might be as simple as adding a
"prisma": {
"schema": "./packages/db/prisma/schema.prisma"
},
"prisma": {
"schema": "./packages/db/prisma/schema.prisma"
},
to the package.json I will test more That does seem to be the answer ^^