aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/migrations/tables/wiki
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-14 20:42:41 +0100
committerGravatar GitHub <[email protected]>2018-05-14 20:42:41 +0100
commitb7fe5de12be5c9f02adeedba45befee751ea68be (patch)
tree740be4b7dff4a8e70616e1663375ef1940604d53 /pysite/migrations/tables/wiki
parentSwitch from using abort to using werkzeug exception (diff)
Migration runner and migrations (#69)
* Migration runner and migrations * Remove demo wiki data * [Staff] Table management pages * Fix weird travis build omission * Address review and comments by @Volcyy * [Tables] Fix pagination * Move table definitions to new file with nameduple * Linting * Address lemon's review comments * Address @Volcyy's review * Address lemon's review * Update search placeholder * Search by key now available
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)