CREATE TABLE `devops_meta_definition`  (
  `meta_definition_id` bigint NOT NULL COMMENT '模型定义id',
  `business_category_id` bigint NOT NULL COMMENT '所属业务分类id',
  `business_id` bigint NOT NULL COMMENT '所属业务id',
  `meta_model_id` bigint NOT NULL COMMENT '所属模型id',
  `fld_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型定义的版本号，例如：1.0',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否删除：Y-已删除，N-未删除',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` bigint NULL DEFAULT 1 COMMENT '租户id',
  PRIMARY KEY (`meta_definition_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '元数据-定义' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_meta_field`  (
  `field_id` bigint NOT NULL COMMENT '字段id',
  `business_category_id` bigint NOT NULL COMMENT '所属业务分类id',
  `business_id` bigint NOT NULL COMMENT '所属业务id',
  `meta_model_id` bigint NOT NULL COMMENT '所属模型id',
  `meta_definition_id` bigint NOT NULL COMMENT '所属模型定义id',
  `field_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性编码(下划线命名)，例如：user_account',
  `field_type` tinyint NOT NULL COMMENT '字段类型：10-可变字符串，11-超长字符串，12-固定长度字符串，20-整型，21-长整型，30-浮点数，50-日期时间，51-日期，52-时间，60-对象，61-列表（集合）',
  `field_length` int NULL DEFAULT NULL COMMENT '长度',
  `decimal_length` int NULL DEFAULT 0 COMMENT '小数位数',
  `not_empty_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '非空标识：Y-非空，N-可为空',
  `key_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '主键标识：Y-主键，N-非主键',
  `default_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '默认值',
  `real_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'Y' COMMENT '是否是真实字段：Y-真实，N-不真实',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
  `default_form_component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '默认元素绑定的表单元素类型',
  `fld_sort` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` bigint NULL DEFAULT 1 COMMENT '租户id',
  PRIMARY KEY (`field_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '元数据-字段' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_meta_model`  (
  `meta_model_id` bigint NOT NULL COMMENT '模型id',
  `business_category_id` bigint NOT NULL COMMENT '所属业务分类id',
  `business_id` bigint NOT NULL COMMENT '所属业务id',
  `meta_model_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型名称',
  `meta_model_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模型编码',
  `system_code` int NOT NULL COMMENT '系统编码，这里用十进制存储，但是展示的时候是3位36进制的字符串，例如展示的时候可能显示：#AZZZ',
  `system_code_show` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '系统编码，用于展示',
  `current_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'v1.0' COMMENT '当前版本号，默认1.0',
  `current_definition_id` bigint NULL DEFAULT NULL COMMENT '当前的模型定义id',
  `description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目描述',
  `meta_model_type` int NOT NULL COMMENT '模型类型：1-新建表，2-外部表',
  `link_model_id` bigint NULL DEFAULT NULL COMMENT '关联的外部模型的id',
  `main_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Y' COMMENT '是否是主表：Y-是，N-否',
  `sub_table_field_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '子表中关联主表主键id的字段编码，例如子表中的user_id属性',
  `sub_table_type` tinyint NULL DEFAULT NULL COMMENT '子表类型：1-一对一，2-一对多',
  `fld_sort` decimal(10, 2) NULL DEFAULT 1000.00 COMMENT '排序',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N' COMMENT '是否删除：Y-已删除，N-未删除',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`meta_model_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '元数据-模型' ROW_FORMAT = Dynamic;

CREATE TABLE `devops_meta_user_dict`  (
  `meta_user_dict_id` bigint NOT NULL COMMENT '主键id',
  `business_id` bigint NULL DEFAULT NULL COMMENT '所属业务id',
  `dict_type_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典类型编码',
  `dict_type_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典类型名称',
  `dict_type_sort` decimal(10, 0) NULL DEFAULT NULL COMMENT '排序',
  `dict_list` json NULL COMMENT '字典列表,obj list形式',
  `version_flag` bigint NULL DEFAULT NULL COMMENT '乐观锁',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否删除：Y-已删除，N-未删除',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
  `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
  `update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
  `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`meta_user_dict_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '元数据-用户字典' ROW_FORMAT = Dynamic;

INSERT INTO `sys_dict_type`(`dict_type_id`, `dict_type_class`, `dict_type_bus_code`, `dict_type_code`, `dict_type_name`, `dict_type_name_pinyin`, `dict_type_desc`, `status_flag`, `dict_type_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703795828615729153, 2, NULL, 'FIELD_TYPE', '字段类型', 'zdlx', NULL, 1, 100.00, 0, 'N', '2023-09-18 23:39:15', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict_type`(`dict_type_id`, `dict_type_class`, `dict_type_bus_code`, `dict_type_code`, `dict_type_name`, `dict_type_name_pinyin`, `dict_type_desc`, `status_flag`, `dict_type_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703939388267827201, 1, NULL, 'SQL_IMPORT_TYPE', 'sql导入数据库类型', 'sqldrsjklx', NULL, 1, 100.00, 0, 'N', '2023-09-19 09:09:42', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703795887310819330, 1703795828615729153, '10', '可变字符串', 'cgzfc', NULL, NULL, NULL, -1, '[-1],', 1, 100.00, 0, 'N', '2023-09-18 23:39:29', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703795909968449537, 1703795828615729153, '11', '超长字符串', 'czzfc', NULL, NULL, NULL, -1, '[-1],', 1, 101.00, 1, 'N', '2023-09-18 23:39:35', 1339550467939639299, '2023-09-18 23:39:55', 1339550467939639299);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703795952553218050, 1703795828615729153, '12', '固定长度字符串', 'gdzdzfc', NULL, NULL, NULL, -1, '[-1],', 1, 102.00, 1, 'N', '2023-09-18 23:39:45', 1339550467939639299, '2023-09-18 23:40:01', 1339550467939639299);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796067267432450, 1703795828615729153, '20', '整型', 'zx', NULL, NULL, NULL, -1, '[-1],', 1, 103.00, 0, 'N', '2023-09-18 23:40:12', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796091137216513, 1703795828615729153, '21', '长整型', 'zzx', NULL, NULL, NULL, -1, '[-1],', 1, 104.00, 0, 'N', '2023-09-18 23:40:18', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796118391803905, 1703795828615729153, '30', '浮点数', 'fds', NULL, NULL, NULL, -1, '[-1],', 1, 105.00, 0, 'N', '2023-09-18 23:40:24', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796168933167106, 1703795828615729153, '50', '日期时间', 'rqsj', NULL, NULL, NULL, -1, '[-1],', 1, 106.00, 0, 'N', '2023-09-18 23:40:36', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796221240332290, 1703795828615729153, '51', '日期', 'rq', NULL, NULL, NULL, -1, '[-1],', 1, 107.00, 0, 'N', '2023-09-18 23:40:49', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796255172251649, 1703795828615729153, '52', '时间', 'sj', NULL, NULL, NULL, -1, '[-1],', 1, 108.00, 0, 'N', '2023-09-18 23:40:57', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796299527016450, 1703795828615729153, '60', '对象', 'dx', NULL, NULL, NULL, -1, '[-1],', 1, 109.00, 0, 'N', '2023-09-18 23:41:07', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703796340396314626, 1703795828615729153, '61', '列表（集合）', 'lb（jh）', NULL, NULL, '', -1, '[-1],', 1, 110.00, 1, 'N', '2023-09-18 23:41:17', 1339550467939639299, '2023-09-18 23:42:20', 1339550467939639299);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1703939453963210753, 1703939388267827201, 'mysql', 'Mysql数据库', 'Mysqlsjk', NULL, NULL, NULL, -1, '[-1],', 1, 100.00, 0, 'N', '2023-09-19 09:09:58', 1339550467939639299, NULL, NULL);

INSERT INTO `sys_dict`(`dict_id`, `dict_type_id`, `dict_code`, `dict_name`, `dict_name_pinyin`, `dict_encode`, `dict_short_name`, `dict_short_code`, `dict_parent_id`, `dict_pids`, `status_flag`, `dict_sort`, `version_flag`, `del_flag`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1760100928735404034, 1353547215422132226, 'low_code', '低代码配置', 'ddmpz', NULL, NULL, NULL, -1, '[-1],', 1, 90.00, 1, 'N', '2024-02-21 08:35:37', 1339550467939639299, '2024-02-21 08:35:45', 1339550467939639299);