Closed vlad-kiratech closed 3 years ago
We don't have support for migration changes that involve setting defaults other then Null. Bytea is the datatype used for the encryption at the Postgres level. Setting a default of 0
in the migration will not work because the default is not encrypted. There is no such thing as a default for bytea -- it just sorta works at the Django level because the default of 0 when an object is created gets encrypted. A PR is welcome to solve this issue.
@vlad-kiratech See:
https://github.com/incuna/django-pgcrypto-fields#migrating-existing-fields-into-pgcrypto-fields
This same thing applies to adding a new default in a migration.
The issue is described in this SO topic. Looks like it has existed for over a year. I ran into it today, and seting
null=True
doesn't actually help. Any ideas if it has ever been resolved?