Hey Everyone so we have been using prisma fora whi...
# orm-help
m
Hey Everyone so we have been using prisma fora while. I had a relation on one of the models and it had the
@unique
tag on that relation. I have removed the unique tag because we changed the structure of the DB however
prisma migrate
does not see the change and says the schema is in sync with the DB but it is not as my db still has the unique foreign key constraint. Anyway I can get the
migrate
system to pick up this change to for the change of the constraint?
a
Are you running
prisma migrate dev
I just ran into the same issue and added the
dev
That seems to do it for mine @Med
m
I did run dev and still would not detect any changes. The only way that I was able to fix my database was deleting the whole relation, creating a migration, then adding the relation, then creating another migration. This however forces you to delete the data in that table 😞
a
Ouch
I'm sorry to hear that
j
This might be a bug - please report it or see if it has already been reported.
To fix it, you can run
npx prisma migrate dev --create-only
, then manually add the SQL to fix the database schema, run
migrate dev
to apply it and from then on everything should be fine.