ALTER TABLE t_samp_knowledge_base
  MODIFY COLUMN collection_name_parent VARCHAR(100) NULL COMMENT 'Milvus集合名称(Table Name)(父)',
  ADD COLUMN has_parent_collection TINYINT NOT NULL DEFAULT 1 COMMENT '是否有父集合: 1-有, 0-无' AFTER collection_name_children;

UPDATE t_samp_knowledge_base
SET has_parent_collection = CASE
  WHEN collection_name_parent IS NULL OR collection_name_parent = '' THEN 0
  ELSE 1
END;
