Open flyte opened 4 years ago
To question 2 I say no; it might work on some databases, but generally no.
To question3, yes. The workaround is a little ugly, but it works. Decrypt each row and compare it to new candidate row and see if there is a collision:
for row in EncryptedModel.objects.all():
if row.unique_attribute == new_unique_attribute:
raise Exception("bruh... are you fr advocating for a full record search?? yes, but only because there is no alternative")
When creating (in a migration) an encrypted field that has
unique=True
, the MySQL backend gives the following error:This SO post explains the reason behind the error: https://stackoverflow.com/a/1827099/1791183
1, Is this something that django-cryptography can fix?
unique=True
even work on an encrypted field?