aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/users/v2.py
blob: 820d0d6d3ee57b8cd032c8b7fd38874463ea224f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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)