From a9368a32b28a5904934e12c9313c34b3f8fa8969 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 5 Jun 2020 21:10:13 +0100 Subject: STATEDB: Avoid depending on SQLite json1 extension The migration to a generalised hosts table uses json_object(), which is part of the optional json1 extension to SQLite. This is not enabled by default, and isn't enabled in the Freedesktop-SDK build of SQLite. Since GitLab tokens shouldn't include double-quotes, we can avoid this by using standard SQL concatenation instead. --- lorrycontroller/migrations/0003-generalise-troves.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lorrycontroller') diff --git a/lorrycontroller/migrations/0003-generalise-troves.py b/lorrycontroller/migrations/0003-generalise-troves.py index bacd2ad..7219ec0 100644 --- a/lorrycontroller/migrations/0003-generalise-troves.py +++ b/lorrycontroller/migrations/0003-generalise-troves.py @@ -34,7 +34,7 @@ yoyo.step('INSERT INTO hosts ' 'SELECT trovehost, protocol, username, password, ' "CASE WHEN gitlab_token IS NULL THEN 'trove' ELSE 'gitlab' END, " "CASE WHEN gitlab_token IS NULL THEN '{}' " - "ELSE json_object('private-token', gitlab_token) END, " + "ELSE '{\"private-token\":\"' || gitlab_token || '\"}' END, " 'lorry_interval, lorry_timeout, ls_interval, ls_last_run, prefixmap, ' 'ignore ' 'FROM troves') -- cgit v1.2.1