django-cryptography
django-cryptography copied to clipboard
Remove encryption
Hello, We've been using this package in the fields of a model, but we want to remove encryption from some fields now cause we need to do search lookups. I'm wondering which is the best way to do this. Would it be enough just removing encrypt() from model fields and run makemigrations/migrate? I Guess data will remain encrypted into the DB.
I was thinking in writting some custom migrations like this: 1.- Given field_x is encrypted, add another field field_x_text to the model 2.- Read data from field_x to get unencrypted value and write it in field_x_text 3- Remove field_x 4.- Rename field_x_text to field_x
Any advice would be appreciated. Thanks
Some of the comments in another issue might help you get this migration complete.
You have basically the right workflow written out. Be sure to backup your database before starting :)