P
Prisma6mo ago
Niels

Prevent prisma from dropping custom index

How can I prevent prisma from trying to drop my custom index every time I try to run migrate dev?
CREATE INDEX idx_meterid_readingat_covering
ON "Reading" ("meterId", "readingAt")
INCLUDE ("value", "id", "createdAt", "updatedAt", "invoiceId");
CREATE INDEX idx_meterid_readingat_covering
ON "Reading" ("meterId", "readingAt")
INCLUDE ("value", "id", "createdAt", "updatedAt", "invoiceId");
4 Replies
Prisma AI Help
Prisma AI Help6mo ago
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul6mo ago
Did you have a look at this issue? https://github.com/prisma/prisma/issues/12914 It's similar to what you are running into.
Nurul
Nurul6mo ago
GitHub
Prisma drops indexes defined outside of Prisma · Issue #12914 · p...
Problem I don't know if this is feature request or a bug report. When possible, developers should define indexes using Prisma schema language. However there are many scenarios where a developer...
Niels
NielsOP6mo ago
Yes, although, this didn't help. When pulling the schema, it defines it wiithout the "include", and thus tries to drop my custom index again.

Did you find this page helpful?