-- 상단(primary) 네비게이션 계층·폴더(접기) 지원, 하단(footer)은 평면 유지
ALTER TABLE navigation_items
  ADD COLUMN IF NOT EXISTS parent_id UUID REFERENCES navigation_items (id) ON DELETE CASCADE,
  ADD COLUMN IF NOT EXISTS is_folder BOOLEAN NOT NULL DEFAULT false;

ALTER TABLE navigation_items DROP CONSTRAINT IF EXISTS navigation_items_location_label_url_key;

CREATE INDEX IF NOT EXISTS navigation_items_location_parent_sort_idx
  ON navigation_items (location, parent_id, sort_order ASC, label ASC);
