🐛 Migration to solve a problem with mime types

This commit is contained in:
alonso.torres 2021-07-05 18:14:11 +02:00
parent 6e40e4e994
commit f312c122ca
2 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,8 @@
-- Fix problem with content-type inconherence
UPDATE storage_object so
SET metadata = jsonb_set(metadata, '{~:content-type}', to_jsonb(fmo.mtype))
FROM file_media_object fmo
WHERE so.id = fmo.media_id and
so.metadata->>'~:content-type' != fmo.mtype;