Studio is not working with multifile schemas
I have created a folder
schema
and added the following code to the schema.prisma
file
I can read from and write to the database, but when I run Prisma Studio, I get the following error:
The table main.User
does not exist in the current database.8 Replies
Hello @sid 👋
What is your prisma version?
I just tried using Prisma studio with
prismaSchemaFolder
in a sqlite database and it worked as expected for me.
This was my schema file
And this was my user.prisma file
When I ran
npx prisma studio
The user model opened as expectedHi!
I have 6.0.1 prisma and client.
I tried it on 6.0.1 and it still works
Did you run
npx prisma db push
or npx prisma migrate dev
?I tried setting:
and it works fine. Thanks!
However, when I use
DATABASE_URL="file:../dev.db"
I get the following error.
Is this a bug or intended behavior?No, it should work as expected. The change you did just changes the location of db file.
I tried changing the location of db in schema file like this:
And it worked as expected (see the new dev.db created outside prisma folder)
I am still getting this error with the parent directory.
Is there anything I can provide to help figure out the cause? Or do I need to clear some Prisma cache or something like that?
Could you try running
npx prisma db push
before running npx prisma studio
and check if you still get the same error?