incuna / django-pgcrypto-fields

Transparent field level encryption for Django using the pgcrypto postgresql extension.
BSD 2-Clause "Simplified" License
229 stars 49 forks source link

Length of character varying columns in database is insufficient #594

Closed caipirginka closed 8 months ago

caipirginka commented 8 months ago

After applying the migration for a Model, having an encripted CharField, such as: first_name = models.CharField(_("first name"), max_length=150, blank=True)

the corresponding column of the database is created as: first_name | character varying(150) | | not null

but the encripted value may be larger than 150 character.

What I'm supposed to do to circumvent this problem?

caipirginka commented 8 months ago

Pardon me... it seems I have done something wrong, because I tried again, using a different Model (the previous case happened while subclassing AbstractUser) and the database column is created as bytea.