diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-06-05 21:10:13 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-06-08 20:34:38 +0100 |
commit | a9368a32b28a5904934e12c9313c34b3f8fa8969 (patch) | |
tree | c2159c279e0c78115539aebe1920cf33f9aaea84 /lorrycontroller | |
parent | dddd932f93b81a4d0d4477c80544f23efab37217 (diff) | |
download | lorry-controller-a9368a32b28a5904934e12c9313c34b3f8fa8969.tar.gz |
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.
Diffstat (limited to 'lorrycontroller')
-rw-r--r-- | lorrycontroller/migrations/0003-generalise-troves.py | 2 |
1 files changed, 1 insertions, 1 deletions
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') |