aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/users/v1.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysite/migrations/tables/users/v1.py')
-rw-r--r--pysite/migrations/tables/users/v1.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pysite/migrations/tables/users/v1.py b/pysite/migrations/tables/users/v1.py
new file mode 100644
index 00000000..9ba70142
--- /dev/null
+++ b/pysite/migrations/tables/users/v1.py
@@ -0,0 +1,11 @@
+def run(db, table, table_obj):
+ """
+ Remove stored email addresses from every user document
+ """
+
+ for document in db.get_all(table):
+ if "email" in document:
+ del document["email"]
+
+ db.insert(table, document, conflict="update", durability="soft")
+ db.sync(table)