← back to Costa Rica

scripts/migrate_002_images.sql

13 lines

-- Image attribution (Steve's no-stock-images rule: every image needs a verifiable source).
-- We store the image we display + the human-readable credit + the page URL we'd link to.

ALTER TABLE regions  ADD COLUMN IF NOT EXISTS image_url         TEXT;
ALTER TABLE regions  ADD COLUMN IF NOT EXISTS image_credit      TEXT;
ALTER TABLE regions  ADD COLUMN IF NOT EXISTS image_license     TEXT;
ALTER TABLE regions  ADD COLUMN IF NOT EXISTS image_source_url  TEXT;
ALTER TABLE regions  ADD COLUMN IF NOT EXISTS image_fetched_at  TIMESTAMPTZ;

ALTER TABLE places   ADD COLUMN IF NOT EXISTS image_credit      TEXT;
ALTER TABLE places   ADD COLUMN IF NOT EXISTS image_license     TEXT;
ALTER TABLE places   ADD COLUMN IF NOT EXISTS image_source_url  TEXT;