Files
twenty/packages/twenty-server
Weiko c993f2de0b Fix user email unique constraint (#8898)
## Context
Fix wrong unique index on user email as we don't want an index on
email/deletedAt but a partial on a where condition on deletedAt. This
should enforce email unicity excluding the ones that have a deletedAt

## Test
Run
```sql
SELECT email, COUNT(*) as duplicate_count
FROM core."user"
WHERE "deletedAt" IS NULL
GROUP BY email
HAVING COUNT(*) > 1
ORDER BY duplicate_count DESC;
```
to check duplicates before running the migration
2024-12-05 15:54:12 +01:00
..
2024-09-18 17:35:08 +02:00
2024-09-20 11:02:52 +02:00
2024-10-05 00:23:23 +02:00
2024-11-22 11:53:33 +01:00