-- Portraits and logos from Wikimedia Commons (via Wikidata P18 / P154). The image itself sits in person.photo_url or -- organization.logo_url; official photos (Parliament, European Parliament) take precedence and are never replaced. -- The licence data is keyed by the image URL, so the credit always belongs to the image that is actually shown. CREATE TABLE image_credit ( url TEXT PRIMARY KEY, page_url TEXT, -- file description page on Commons credit TEXT, -- author / attribution as plain text license TEXT, -- short name, e.g. "CC BY-SA 4.0" license_url TEXT, source_slug TEXT NOT NULL, updated_at TIMESTAMPTZ NOT NULL DEFAULT now() ); COMMENT ON TABLE image_credit IS 'Licence and attribution for third-party images in person.photo_url / organization.logo_url (Wikimedia Commons). No row = official photo of the source (Parliament, EP).';