


-- 2026-02-04

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;






-- 2026-02-02 
-- 2026-02-02  授权码 表增加 是否删除标志位
alter table t_oauth_authorization_codes add column `is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除';

-- 
ALTER TABLE t_samp_knowledge_base 
  CHANGE `collection_name` `collection_name1` 
    VARCHAR(100)  NOT NULL 
    COMMENT 'Milvus集合名称(Table Name)(父)',
  ADD `collection_name2` 
    VARCHAR(100)  NOT NULL 
    COMMENT 'Milvus集合名称(Table Name)(子)';






-- 施工标准规范、施工方案元数据字段信息

INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('0e6bc8e3-1e54-40e9-918c-58c70078feb1', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '方案概述', 'plan_summary', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('18065ede-a630-4422-b225-369f2df72a3a', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '文档层级信息', 'hierarchy', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('187e391e-85dd-40ad-a011-98536d763064', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '文件URL', 'file_url', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('1d40e6f1-c227-4623-88cb-ae517d3ec87f', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '文件名称', 'file_name', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('507f5ad5-2aa8-439a-bf88-e05961b315ee', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '文件类型', 'document_type', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('50f4ab3c-780f-4930-b391-8b7280a29ae9', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '编制单位', 'compiling_unit', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('55a82dd5-1aaf-437b-886d-814ace66e9da', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '编制日期', 'compiling_date', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('5b324468-fa6c-4b37-8c3f-6dad3e25650f', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '标准编号', 'standard_number', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('5c0096ac-f142-4f26-8b6f-bfb790361185', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '四级分类', 'type_level_4', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('8e17feb6-02cd-4ac2-b2fa-9e4bb194acf4', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '文件URL', 'file_url', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('904bebe1-4063-4ca3-8eb4-65e3f0e35835', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '施工方案类型', 'plan_type', 'text', '');


INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('9f980a1b-35f8-49c0-8c84-7223c6e36b8b', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '发布单位', 'issuing_authority', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('a77936ba-3f87-4928-9910-f01f1809410c', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '文件名称', 'file_name', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('b5459405-411a-4957-87c1-90c8177037c0', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '方案名称', 'plan_name', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('b62f8410-a8f9-48e8-bc0c-48006c7d63ad', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '分块唯一id', 'chunk_id', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('bfb7661c-46c7-4159-9b3a-9fd9e9c8a503', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '专业领域', 'professional_field', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('c00720a4-2884-4f25-bf96-0be1a7f63e62', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '三级分类', 'type_level_3', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('c2263e6e-26f9-4835-9a6e-e31758725dfb', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '工程名称', 'project_name', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('ca5ef925-beb3-4c7e-89e0-58298837a0c7', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '二级分类', 'type_level_2', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('e60c8a7e-e0af-47d8-8eeb-ef8e4d0db02d', 'a61e1530-9ff3-4640-b2f7-fe7c9edfcbc1', '文档层级信息', 'hierarchy', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('e63df93a-4a6b-405c-a479-acad6859d518', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '施工地', 'construction_site', 'text', '');
INSERT INTO `t_samp_metadata`(`id`, `knowledge_base_id`, `field_zh_name`, `field_en_name`, `field_type`, `remark`) VALUES ('f2af7d41-22c4-4934-99b2-913d300dd31a', 'a6b7280f-63be-494f-8f16-9d4415b9b559', '一级分类', 'type_level_1', 'text', '');

