aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pysite/migrations/tables/code_jams/__init__.py0
-rw-r--r--pysite/migrations/tables/code_jams/v1.py11
2 files changed, 11 insertions, 0 deletions
diff --git a/pysite/migrations/tables/code_jams/__init__.py b/pysite/migrations/tables/code_jams/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/pysite/migrations/tables/code_jams/__init__.py
diff --git a/pysite/migrations/tables/code_jams/v1.py b/pysite/migrations/tables/code_jams/v1.py
new file mode 100644
index 00000000..cce3b112
--- /dev/null
+++ b/pysite/migrations/tables/code_jams/v1.py
@@ -0,0 +1,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)