aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/users
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-31 13:50:49 +0100
committerGravatar Gareth Coles <[email protected]>2018-05-31 13:50:49 +0100
commitc4c107ad6d3093d9d33ffb4f41a10e59efaddb45 (patch)
tree6ebd27b62b6e58e947c119f9f62866b9ec93c2fb /pysite/migrations/tables/users
parentSwitch 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/users')
-rw-r--r--pysite/migrations/tables/users/v2.py11
1 files changed, 11 insertions, 0 deletions
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)