From 3ed55584903a1f326f0b33c265d6c2fa7aea4d19 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Sun, 4 Oct 2020 04:29:14 +0200 Subject: [PATCH] Fix query to account for new column type. The type of the file_data.data column was changed from JSON to JSONB by commit 2d270cdef91da6430b7a7bae92be44a6dbc0d475. Fixes #54. --- bin/datastore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/datastore.py b/bin/datastore.py index ddad3fc..2dadbfe 100644 --- a/bin/datastore.py +++ b/bin/datastore.py @@ -563,7 +563,7 @@ class Datastore: INSERT INTO labels (name, data) SELECT l.key, l.value FROM file_data fd, - json_each(fd.data->'labels') l + jsonb_each(fd.data->'labels') l WHERE fd.data::jsonb ? 'labels' ON CONFLICT (name) DO UPDATE SET data = excluded.data; """