-- Homepage SEO fields (match page_translations metadata)
-- Run after 003_homepage_translations.sql

ALTER TABLE homepage_translations
  ADD COLUMN og_image VARCHAR(500) NOT NULL DEFAULT '' AFTER meta_description,
  ADD COLUMN canonical_url VARCHAR(500) NOT NULL DEFAULT '' AFTER og_image,
  ADD COLUMN json_ld JSON NULL AFTER canonical_url,
  ADD COLUMN noindex TINYINT(1) NOT NULL DEFAULT 0 AFTER json_ld;

UPDATE homepage_translations SET canonical_url = CONCAT('/', locale, '/') WHERE canonical_url = '';
