"Duplicate Index" - but no dupliacte index...
Hey there, I've HAD a duplicate index in one of my schemas:
which resulted in the first one overridden in the generated migration.
this code is already deployed
I added 2 columns, (e.g f3 and f4) and when I'm trying to generate migrations (pg) I'm getting
Even though currently I've no duplication nowhere...
I want to fix it now, so I changed to the very very sure that's not duplicate:
but I get the same error...
If I remove all of them completely, The generation succeeds.
Whay am I missing?
9 Replies
Try manually running the following query and see what comes out. I feel like this is a good first debugging step:
Also, your diplicate index, might be comming from another table, so check the migration file and to actually see that index drizzle-kit is actually trying to create
this was coming out when I was trying to generate migrations...
Anyway, I think it had to do with some weird state of files on my machine
Very likely
index names should be unique across all tables
In case you are still having this issue and do not have any duplicate index, I was having this issue with no duplicate indexes (using Postgres) doing the following commands (im using pnpm):
First i ran:
pnpm drizzle-kit up:pg
Then uninstalled both packages:
pnpm remove drizzle-kit drizzle-orm
Then installed both packages (clean install)
pnpm add drizzle-kit drizzle-orm
My version of drizzle-kit was updated to a newer version and i was able to run pnpm drizzle-kit generate:pg
without any issue successfully adding the migration i was trying to add.cool! thanks for giving an answer 🙂
I actually had to workaround this problem, but it's good to know that a valid solution is available
Just out of curiosity, what was your workaround?
drop all indexes, recreate them... =[
I have the same issue. I removed my docker container and rerun again and I still have this issue.
Any idea ?