diff options
author | 2018-05-31 13:50:49 +0100 | |
---|---|---|
committer | 2018-05-31 13:50:49 +0100 | |
commit | c4c107ad6d3093d9d33ffb4f41a10e59efaddb45 (patch) | |
tree | 6ebd27b62b6e58e947c119f9f62866b9ec93c2fb /pysite/migrations/tables | |
parent | Switch constants around (diff) |
Update privacy policy and related migrations
* Don't collect DOB anymore, and remove it from database
* Make doubly-sure all emails are gone because I'm paranoid and "update" doesn't do what it sounds like
Diffstat (limited to 'pysite/migrations/tables')
-rw-r--r-- | pysite/migrations/tables/code_jam_participants/__init__.py | 0 | ||||
-rw-r--r-- | pysite/migrations/tables/code_jam_participants/v1.py | 11 | ||||
-rw-r--r-- | pysite/migrations/tables/users/v2.py | 11 |
3 files changed, 22 insertions, 0 deletions
diff --git a/pysite/migrations/tables/code_jam_participants/__init__.py b/pysite/migrations/tables/code_jam_participants/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/pysite/migrations/tables/code_jam_participants/__init__.py diff --git a/pysite/migrations/tables/code_jam_participants/v1.py b/pysite/migrations/tables/code_jam_participants/v1.py new file mode 100644 index 00000000..c6e7bff6 --- /dev/null +++ b/pysite/migrations/tables/code_jam_participants/v1.py @@ -0,0 +1,11 @@ +def run(db, table, table_obj): + """ + Remove stored dates of birth from code jam participants + """ + + for document in db.get_all(table): + if "dob" in document: + del document["dob"] + + db.insert(table, document, conflict="replace", durability="soft") + db.sync(table) diff --git a/pysite/migrations/tables/users/v2.py b/pysite/migrations/tables/users/v2.py new file mode 100644 index 00000000..820d0d6d --- /dev/null +++ b/pysite/migrations/tables/users/v2.py @@ -0,0 +1,11 @@ +def run(db, table, table_obj): + """ + Remove stored email addresses from every user document - "apparently `update` doesn't update" update + """ + + for document in db.get_all(table): + if "email" in document: + del document["email"] + + db.insert(table, document, conflict="replace", durability="soft") + db.sync(table) |