https://www.prisma.io/ logo
#orm-help
Title
# orm-help
v

Vladi Stevanovic

09/26/2022, 3:34 PM
From @Gourave Verma
Hey all, I'm trying to use prisma along with this article to create a multi tenant application. I have everything setup, but when I try to migrate, I can't create tables in other schemas in my database.
When I try to run a query like
.create
I get an error like
Copy code
The table `e874649f-ac3e-47c0-bbd5-994fdd7dc116.User` does not exist in the current database.
which makes sense.
Im new to prisma so I was wondering if anyone had any ideas on how I could create the tables specified in
schema.prisma
in my db when I run migrate
1
n

Nurul

09/27/2022, 11:01 AM
Hey @Gourave Verma 👋 Which command are you invoking to apply the migrations? If you invoke
npx prisma migrate dev
then it should create as well as apply your migrations, after which your queries should work as expected.
g

Gourave Verma

09/27/2022, 3:26 PM
Hey @Nurul thanks for replying. I'm using
yarn prisma migrate dev
the only issue I have is pushing the migrations to other schemas. Right now I can only specify one schema type. Is there a way to call migrate and push the migrations to all schemas?
n

Nurul

09/28/2022, 11:53 AM
For now, you would need to change the schema name in your database connection string and invoke the migrate dev command for each of your schemas. We are working on adding support for using multiple schemas with migrate, that should make it much easier for you.
g

Gourave Verma

09/30/2022, 12:52 AM
That makes sense. Thanks for your help
💚 1
💯 1
🙌 1
3 Views