P
Prisma5mo ago
fjuk

how to create the _prisma_migration table in a specific schema?

I do not have perms on the Public schema due to how the db and its perms are set up. Is there a way to config prisma so that the migrations table will be created in a different schema? For example, under a "prisma" schema or something like that?
3 Replies
Nurul
Nurul5mo ago
Hey 👋 You could specify the schema name in connection string, once you do that _prisma_migrations table would be created in the schema that you specified. Also, just to clarify, would your other tables be in the same schema or would they be in a different schema?
fjuk
fjuk5mo ago
In different schemas Am I going to need to specify extra stuff for this to work with multiple schemas?
Nurul
Nurul5mo ago
Oh Okay, I was assuming that you other tables would also be in the same schema. In that case, I am not 100% sure if this approach would work. I would recommend creating a feature request: https://github.com/prisma/prisma/issues/new?assignees=&labels=&projects=&template=feature_request.md&title= Generally, if you want to work with tables (other than _prisma_migration) across multiple schemas, then you need to enable multiSchema preview feature: https://www.prisma.io/docs/orm/prisma-schema/data-model/multi-schema