aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/code_jams/v1.py
blob: cce3b11230817b124bcbfcb225526bbff2c016d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
def run(db, table, table_obj):
    """
    Add "teams" list to jams without it
    """

    for document in db.get_all(table):
        if "teams" not in document:
            document["teams"] = []

            db.insert(table, document, conflict="replace", durability="soft")
    db.sync(table)