
CREATE TABLE base_ai_chat (
                              `f_id` varchar(50) NOT NULL COMMENT '自然主键',
                              `f_full_name` varchar(200) COMMENT '会话标题',
                              `f_enabled_mark` int COMMENT '有效标志',
                              `f_sort_code` bigint COMMENT '排序',
                              `f_creator_time` datetime COMMENT '创建时间',
                              `f_creator_user_id` varchar(50) COMMENT '创建用户',
                              `f_last_modify_time` datetime COMMENT '修改时间',
                              `f_last_modify_user_id` varchar(50) COMMENT '修改用户',
                              `f_delete_time` datetime COMMENT '删除时间',
                              `f_delete_user_id` varchar(50) COMMENT '删除用户',
                              `f_delete_mark` int COMMENT '删除标志',
                              `f_tenant_id` varchar(50) NOT NULL DEFAULT '0' COMMENT '租户id'

    , PRIMARY KEY (f_id,f_tenant_id)
) ;
ALTER TABLE base_ai_chat COMMENT = 'ai会话列表';
CREATE TABLE base_ai_history (
                                 `f_id` varchar(50) NOT NULL COMMENT '自然主键',
                                 `f_chat_id` varchar(50) COMMENT '会话id',
                                 `f_question_text` text COMMENT '问题内容',
                                 `f_content` text COMMENT '会话内容',
                                 `f_type` int COMMENT '类型（0-ai，1-用户）',
                                 `f_enabled_mark` int COMMENT '有效标志',
                                 `f_sort_code` bigint COMMENT '排序',
                                 `f_creator_time` datetime COMMENT '创建时间',
                                 `f_creator_user_id` varchar(50) COMMENT '创建用户',
                                 `f_last_modify_time` datetime COMMENT '修改时间',
                                 `f_last_modify_user_id` varchar(50) COMMENT '修改用户',
                                 `f_delete_time` datetime COMMENT '删除时间',
                                 `f_delete_user_id` varchar(50) COMMENT '删除用户',
                                 `f_delete_mark` int COMMENT '删除标志',
                                 `f_tenant_id` varchar(50) NOT NULL DEFAULT '0' COMMENT '租户id'

    , PRIMARY KEY (f_id,f_tenant_id)
) ;
ALTER TABLE base_ai_history COMMENT = 'ai会话记录';


ALTER TABLE base_data_interface_log  MODIFY COLUMN `f_oauth_app_id` VARCHAR(50) COMMENT '接口授权AppId';
ALTER TABLE base_db_link  MODIFY COLUMN `f_password` VARCHAR(100) COMMENT '密码';
ALTER TABLE base_db_link  MODIFY COLUMN `f_tenant_id` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT '租户id';
ALTER TABLE base_module_column  MODIFY COLUMN `f_full_name` VARCHAR(200) COMMENT '名称';
ALTER TABLE base_module_column  MODIFY COLUMN `f_en_code` VARCHAR(200) COMMENT '编码';
ALTER TABLE base_module_form  MODIFY COLUMN `f_full_name` VARCHAR(200) COMMENT '名称';
ALTER TABLE base_module_form  MODIFY COLUMN `f_en_code` VARCHAR(200) COMMENT '编码';
ALTER TABLE base_print_log  MODIFY COLUMN `f_id` VARCHAR(50) NOT NULL COMMENT '主键';
ALTER TABLE base_system  MODIFY COLUMN `f_navigation_icon` VARCHAR(500) COMMENT '导航图标';
ALTER TABLE base_visual_filter  MODIFY COLUMN `f_id` VARCHAR(50) NOT NULL COMMENT '主键';
ALTER TABLE blade_visual_component  MODIFY COLUMN `type` INT COMMENT '组件类型';
ALTER TABLE blade_visual_component  MODIFY COLUMN `img` VARCHAR(255) COMMENT '组件图片';
ALTER TABLE blade_visual_db  MODIFY COLUMN `password` VARCHAR(100) COMMENT '密码';
ALTER TABLE blade_visual_db  MODIFY COLUMN `f_tenant_id` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT '租户id';


ALTER TABLE `base_integrate_node`
    CHANGE COLUMN `f_form_Id` `f_form_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单主键' ;


ALTER TABLE `base_permission_group`
    CHANGE COLUMN `F_Id` `f_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自然主键' FIRST,
    CHANGE COLUMN `F_Full_Name` `f_full_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名称' AFTER `f_id`,
    CHANGE COLUMN `F_En_Code` `f_en_code` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编码' AFTER `f_full_name`,
    CHANGE COLUMN `F_Permission_Member` `f_permission_member` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '成员' AFTER `f_en_code`,
    CHANGE COLUMN `F_Sort_Code` `f_sort_code` bigint NULL DEFAULT NULL COMMENT '排序' AFTER `f_permission_member`,
    CHANGE COLUMN `F_Description` `f_description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `f_sort_code`,
    CHANGE COLUMN `F_Enabled_Mark` `f_enabled_mark` int NULL DEFAULT NULL COMMENT '有效标志' AFTER `f_description`,
    CHANGE COLUMN `F_Creator_Time` `f_creator_time` datetime NULL DEFAULT NULL COMMENT '创建时间' AFTER `f_enabled_mark`,
    CHANGE COLUMN `F_Creator_User_Id` `f_creator_user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建用户' AFTER `f_creator_time`,
    CHANGE COLUMN `F_Last_Modify_Time` `f_last_modify_time` datetime NULL DEFAULT NULL COMMENT '修改时间' AFTER `f_creator_user_id`,
    CHANGE COLUMN `F_Last_Modify_User_Id` `f_last_modify_user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改用户' AFTER `f_last_modify_time`,
    CHANGE COLUMN `F_Delete_Mark` `f_delete_mark` int NULL DEFAULT NULL COMMENT '删除标志' AFTER `f_last_modify_user_id`,
    CHANGE COLUMN `F_Delete_Time` `f_delete_time` datetime NULL DEFAULT NULL COMMENT '删除时间' AFTER `f_delete_mark`,
    CHANGE COLUMN `F_Delete_User_Id` `f_delete_user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '删除用户' AFTER `f_delete_time`,
    CHANGE COLUMN `F_Type` `f_type` int NULL DEFAULT NULL COMMENT '类型' AFTER `f_tenant_id`,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`f_id`, `f_tenant_id`) USING BTREE;



ALTER TABLE `ext_employee`
    CHANGE COLUMN `f_ID_number` `f_id_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号' AFTER `f_working_nature`;
