aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/users/v2.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysite/migrations/tables/users/v2.py')
-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)