From 6f237b32894e1fc1973834d6adc1c597ea0fa5f3 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 7 May 2020 19:27:17 +0100 Subject: STATEDB: Generalise 'troves' table to allow more Upstream Host types We need to store different parameters for different upstream host types. Currently the troves table has a 'gitlab_token' column for GitLab upstreams, but in general we might need to have arbitrary parameters. That column's value is also how we determine the host type(!). * Add an explicit 'type' column * Replace the 'gitlab_token' column with a 'type_params' column that is a JSON dictionary of type-specific parameters While we're at it, and since it makes the migration simpler: * Replace 'troves' table with 'hosts' table Closes #10. --- yarns.webapp/900-implementations.yarn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yarns.webapp') diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn index 9a759ba..fc88fd4 100644 --- a/yarns.webapp/900-implementations.yarn +++ b/yarns.webapp/900-implementations.yarn @@ -447,5 +447,5 @@ any rows in them. IMPLEMENTS THEN STATEDB is empty test -s "$DATADIR/webapp.db" - sqlite3 "$DATADIR/webapp.db" 'SELECT * FROM troves;' | stdin_is_empty + sqlite3 "$DATADIR/webapp.db" 'SELECT * FROM hosts;' | stdin_is_empty sqlite3 "$DATADIR/webapp.db" 'SELECT * FROM lorries;' | stdin_is_empty -- cgit v1.2.1