PrismaP
Prisma2y ago
1 reply
Kilian

How to add new schema with multiSchema feature without database reset

When adding a new empty schema to out prisma.schema migration detects a drift and asks us to drop the database even though nothing else has changed. How can I add a new empty schema without dropping all the data?

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["multiSchema", "views", "relationJoins"]
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
  schemas  = ["schema1", "public", "new_schema"]
}
Was this page helpful?