Add logos to trust_centers and auto fill with organization logo

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-29 14:58:38 +04:00
parent 88ca5f6968
commit d381c5fc88
3 changed files with 60 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
ALTER TABLE
trust_centers
ADD
COLUMN logo_file_id TEXT REFERENCES files(id) ON UPDATE CASCADE ON DELETE
SET
NULL,
ADD
COLUMN dark_logo_file_id TEXT REFERENCES files(id) ON UPDATE CASCADE ON DELETE
SET
NULL;
UPDATE
trust_centers t
SET
logo_file_id = o.logo_file_id
FROM
organizations o
WHERE
t.organization_id = o.id
AND t.logo_file_id IS NULL;