aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/wiki
diff options
context:
space:
mode:
Diffstat (limited to 'pysite/migrations/tables/wiki')
-rw-r--r--pysite/migrations/tables/wiki/__init__.py0
-rw-r--r--pysite/migrations/tables/wiki/v1.py7
2 files changed, 7 insertions, 0 deletions
diff --git a/pysite/migrations/tables/wiki/__init__.py b/pysite/migrations/tables/wiki/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/pysite/migrations/tables/wiki/__init__.py
diff --git a/pysite/migrations/tables/wiki/v1.py b/pysite/migrations/tables/wiki/v1.py
new file mode 100644
index 00000000..a5282f28
--- /dev/null
+++ b/pysite/migrations/tables/wiki/v1.py
@@ -0,0 +1,7 @@
+def run(db, table, table_obj):
+ for document in db.pluck(table, table_obj.primary_key, "title"):
+ if not document.get("title"):
+ document["title"] = "No Title"
+
+ db.insert(table, document, conflict="update", durability="soft")
+ db.sync(table)