Fix query to account for new column type.

The type of the file_data.data column was
changed from JSON to JSONB by commit
2d270cdef9.

Fixes #54.
This commit is contained in:
D. Berge
2020-10-04 04:29:14 +02:00
parent 3de7d5d334
commit 3ed5558490

View File

@@ -563,7 +563,7 @@ class Datastore:
INSERT INTO labels (name, data) INSERT INTO labels (name, data)
SELECT l.key, l.value SELECT l.key, l.value
FROM file_data fd, FROM file_data fd,
json_each(fd.data->'labels') l jsonb_each(fd.data->'labels') l
WHERE fd.data::jsonb ? 'labels' WHERE fd.data::jsonb ? 'labels'
ON CONFLICT (name) DO UPDATE SET data = excluded.data; ON CONFLICT (name) DO UPDATE SET data = excluded.data;
""" """