Partial unique indexes are being recreated on every migration with prisma migrate #13417
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
team/schema
Issue for team Schema.
topic: endless migrations
topic: indexes
topic: partial index
topic: postgresql
Bug description
We are using partial unique indexes, since we are implementing soft delete-adding
deletedAt
column to our models.Since we want the columns to still behave as unique, we mark them with
@unique
,and modify the migration file to add
where ("deletedAt" is null)
to the index creation.For example:
Whenever we want to create a new migration file this warning shows:
although the index is already created, and the created index statement is added to the migration file.
How to reproduce
Expected behavior
Should not try to create unique indexes again.
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: