From c5d8157670ea2b7f448fc41ca790b25c03a4bedb Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Thu, 7 Jun 2018 16:34:59 +0100 Subject: Replace GitHub with GitLab across the project --- pysite/migrations/tables/code_jam_participants/v2.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pysite/migrations/tables/code_jam_participants/v2.py (limited to 'pysite/migrations/tables/code_jam_participants') 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) -- cgit v1.2.3