-- EN /listing yolunun CMS page rotası ile ezilmesini düzeltir (katalog grid).
-- Idempotent: tekrar çalıştırılabilir.

UPDATE routes
SET
  type = 'listing',
  entity_id = NULL,
  redirect_to = NULL,
  redirect_status = 301,
  is_active = 1,
  priority = 100,
  meta_title = NULL,
  meta_description = NULL,
  updated_at = CURRENT_TIMESTAMP
WHERE path = '/listing' AND locale IN ('', 'en');

INSERT INTO routes (locale, path, type, entity_id, redirect_to, redirect_status, is_active, priority, meta_title, meta_description)
SELECT 'en', '/listing', 'listing', NULL, NULL, 301, 1, 100, NULL, NULL
WHERE NOT EXISTS (SELECT 1 FROM routes WHERE locale = 'en' AND path = '/listing');
