Prisma, vector embeddings -> Error: schema "extens...
# help-and-questions
v
So I'm trying to set up Prisma with the unsupported vector type. I've enabled the vector extension in the dashboard. My schema.prisma file looks like this:
Copy code
js

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
  extensions = [pgvector(map: "vector", schema: "extensions")] 
}

generator client {
  provider = "prisma-client-js"
  output = env("PRISMA_CLIENT_OUTPUT_DIR")
  previewFeatures = ["postgresqlExtensions"]
}

model Text {
  id Int @id @default(autoincrement())
  title String
  content String
  vector Unsupported("vector (1536)")

}
My initial migration works, but I keep getting this error on subsequent migrations:
Copy code
ERROR: schema "extensions" does not exist
so the issues was coming from the shadow db. was solved by creating another db and using it as the shadow db:
Copy code
js

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
  shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
  extensions = [pgvector(map: "vector", schema: "extensions")]
}

generator client {
  provider = "prisma-client-js"
  output = env("PRISMA_CLIENT_OUTPUT_DIR")
  previewFeatures = ["postgresqlExtensions"]
}