Skip to content

Commit

Permalink
Corrected upgrade instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
radiac committed Aug 13, 2020
1 parent b2a7e36 commit 385e9ad
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions docs/upgrading.rst
Expand Up @@ -20,6 +20,9 @@ in an ``anonymised`` field which gdpr-assist added to your models, but this caus
problems when wanting to anonymise third party models. This flag has now been moved to a
new model in the gdpr-assist app, linked to your objects using a generic foreign key.

If you migrate without following these instructions, you will lose information about
which database objects have been anonymised.


Migrating your data
...................
Expand All @@ -34,13 +37,13 @@ to remove the ``anonymised`` field. There is a migration operator to help you:
2. Add the operator using the following migration template::


from django.db.migrations import Migration, RunPython
from django.db.migrations import Migration
from gdpr_assist.upgrading import MigrateGdprAnonymised

class Migration(migrations.Migration):
dependencies = [
('myapp', '0012_migration'), # Update this to your app's last migration
('gdpr_assist', '0002_privacyanonymised'),
('myapp', '0012_migration'), # Added by makemigrations
('gdpr_assist', '0002_privacyanonymised'), # Keep this dependency
]
operations = [
MigrateGdprAnonymised('MyModelOne'), # Update this to your model
Expand All @@ -51,6 +54,13 @@ to remove the ``anonymised`` field. There is a migration operator to help you:

./manage.py makemigrations myapp

4. Repeat for any other apps with anonymisable models

5. Run all migrations

./manage.py migrate
./manage.py migrate --database=gdpr_log


System check gdpr_assist.E001
.............................
Expand Down Expand Up @@ -89,9 +99,6 @@ In most cases no further action will be required, but if you are using the
``anonymised`` field in your own code, you will need to call ``is_anonymised()`` or
query the model ``gdpr_assist.models.PrivacyAnonymised`` instead.

If you migrate without following these instructions, you will lose information about
which database objects have been anonymised.


.. _changelog:

Expand Down

0 comments on commit 385e9ad

Please sign in to comment.