diff options
Diffstat (limited to 'pysite/migrations')
-rw-r--r-- | pysite/migrations/tables/code_jam_participants/v2.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pysite/migrations/tables/code_jam_participants/v2.py b/pysite/migrations/tables/code_jam_participants/v2.py new file mode 100644 index 00000000..858da279 --- /dev/null +++ b/pysite/migrations/tables/code_jam_participants/v2.py @@ -0,0 +1,12 @@ +def run(db, table, table_obj): + """ + GitHub usernames -> Store as GitLab username, this will be correct for most jammers + """ + + for document in db.get_all(table): + if "github_username" in document: + document["gitlab_username"] = document["github_username"] + del document["github_username"] + + db.insert(table, document, conflict="replace", durability="soft") + db.sync(table) |