Skip to content

Commit

Permalink
#64 add feature: fix schema.sql [vip:platform/pallas#879]
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanChan committed Jun 12, 2019
1 parent 1e08881 commit 1aa3109
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pallas-core/src/main/resources/db/ddl/h2/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ CREATE TABLE IF NOT EXISTS `mapping` (
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
`dynamic` tinyint(1) NOT NULL DEFAULT '0' COMMENT '配置dynamic属性是否为true',
`parent_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'parent_id类型,1为nested,2为object,3为multi-fields',
`copy_to` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '复制域数组',
`copy_to` varchar(256) DEFAULT NULL COMMENT '复制域数组',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

Expand Down
4 changes: 2 additions & 2 deletions pallas-core/src/main/resources/db/ddl/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ CREATE TABLE IF NOT EXISTS `mapping` (
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
`dynamic` tinyint(1) NOT NULL DEFAULT '0' COMMENT '配置dynamic属性是否为true',
`parent_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'parent_id类型1为nested,2为object,3为multi-fields',
`copy_to` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '复制域数组',
`parent_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'parent_id类型:1为nested;2为object;3为multi-fields',
`copy_to` varchar(256) DEFAULT NULL COMMENT '复制域数组',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

Expand Down
2 changes: 1 addition & 1 deletion pallas-core/src/main/resources/mapper/h2/MappingMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
insert into mapping (id, parent_id, version_id,
field_name, field_type, multi,
search, doc_value, create_time,
update_time, dynamic)
update_time, dynamic,parent_type,copy_to)
values (#{id,jdbcType=BIGINT}, #{parentId,jdbcType=BIGINT}, #{versionId,jdbcType=BIGINT},
#{fieldName,jdbcType=VARCHAR}, #{fieldType,jdbcType=VARCHAR}, #{multi,jdbcType=BIT},
#{search,jdbcType=BIT}, #{docValue,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ public void testVersionCRUD() throws Exception {
node.put("search", true);
node.put("docValue", true);
node.put("dynamic", false);
node.put("parent_type", 0);
node.put("copy_to", "");

ArrayNode chilren = JsonNodeFactory.instance.arrayNode();
ObjectNode child = JsonNodeFactory.instance.objectNode();
Expand All @@ -148,6 +150,8 @@ public void testVersionCRUD() throws Exception {
child.put("search", true);
child.put("docValue", true);
child.put("dynamic", false);
child.put("parent_type", 0);
child.put("copy_to", "");

ArrayNode array = JsonNodeFactory.instance.arrayNode();
array.add(node);
Expand Down

0 comments on commit 1aa3109

Please sign in to comment.