mirror of
https://gitee.com/dromara/dbswitch.git
synced 2025-09-10 22:19:07 +00:00
version for 1.6.10
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
DBSWITCH_VERSION=1.6.9
|
||||
DBSWITCH_VERSION=1.6.10
|
||||
BUILD_DOCKER_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
PROJECT_ROOT_DIR=$( dirname "$BUILD_DOCKER_DIR")
|
||||
DOCKER_DBSWITCH_DIR=$BUILD_DOCKER_DIR/dbswitch
|
||||
|
@@ -13,7 +13,7 @@ services:
|
||||
MYSQL_ROOT_HOST: '%'
|
||||
dbswitch:
|
||||
container_name: dbswitch_webui
|
||||
image: inrgihc/dbswitch:1.6.9
|
||||
image: inrgihc/dbswitch:1.6.10
|
||||
environment:
|
||||
MYSQLDB_HOST: dbswitch_mysqldb
|
||||
MYSQLDB_PORT: 3306
|
||||
|
@@ -153,6 +153,24 @@
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="只创建表"
|
||||
label-width="240px"
|
||||
:required=true
|
||||
prop="targetOnlyCreate"
|
||||
style="width:65%">
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
只再目标端创建表,不同步数据内容;如果配置为“是”,则下面的“数据处理批次大小"将无效。
|
||||
</div>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
<el-select v-model="createform.targetOnlyCreate">
|
||||
<el-option label='是'
|
||||
:value=true></el-option>
|
||||
<el-option label='否'
|
||||
:value=false></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理批次大小"
|
||||
label-width="240px"
|
||||
:required=true
|
||||
@@ -291,6 +309,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="目地端数据源">[{{createform.targetConnectionId}}]{{targetConnection.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="目地端schema">{{createform.targetSchema}}</el-descriptions-item>
|
||||
<el-descriptions-item label="只创建表">{{createform.targetOnlyCreate}}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据处理批次量">{{createform.batchSize}}</el-descriptions-item>
|
||||
<el-descriptions-item label="表名映射规则">
|
||||
<span v-show="createform.tableNameMapper.length==0">[映射关系为空]</span>
|
||||
@@ -418,6 +437,7 @@ export default {
|
||||
columnNameMapper: [],
|
||||
targetConnectionId: '请选择',
|
||||
targetDropTable: true,
|
||||
targetOnlyCreate: false,
|
||||
targetSchema: "",
|
||||
batchSize: 5000
|
||||
},
|
||||
@@ -736,6 +756,7 @@ export default {
|
||||
tableNameMapper: this.createform.tableNameMapper,
|
||||
columnNameMapper: this.createform.columnNameMapper,
|
||||
targetDropTable: true,
|
||||
targetOnlyCreate: this.createform.targetOnlyCreate,
|
||||
batchSize: this.createform.batchSize
|
||||
}
|
||||
})
|
||||
|
@@ -153,6 +153,24 @@
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="只创建表"
|
||||
label-width="240px"
|
||||
:required=true
|
||||
prop="targetOnlyCreate"
|
||||
style="width:65%">
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
只再目标端创建表,不同步数据内容;如果配置为“是”,则下面的“数据处理批次大小"将无效。
|
||||
</div>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
<el-select v-model="updateform.targetOnlyCreate">
|
||||
<el-option label='是'
|
||||
:value=true></el-option>
|
||||
<el-option label='否'
|
||||
:value=false></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理批次大小"
|
||||
label-width="240px"
|
||||
:required=true
|
||||
@@ -291,6 +309,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="目地端数据源">[{{updateform.targetConnectionId}}]{{targetConnection.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="目地端schema">{{updateform.targetSchema}}</el-descriptions-item>
|
||||
<el-descriptions-item label="只创建表">{{updateform.targetOnlyCreate}}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据处理批次量">{{updateform.batchSize}}</el-descriptions-item>
|
||||
<el-descriptions-item label="表名映射规则">
|
||||
<span v-show="!updateform.tableNameMapper || updateform.tableNameMapper.length==0">[映射关系为空]</span>
|
||||
@@ -424,6 +443,7 @@ export default {
|
||||
columnNameMapper: [],
|
||||
targetConnectionId: '请选择',
|
||||
targetDropTable: true,
|
||||
targetOnlyCreate: false,
|
||||
targetSchema: "",
|
||||
batchSize: 5000
|
||||
},
|
||||
@@ -572,6 +592,7 @@ export default {
|
||||
columnNameMapper: detail.configuration.columnNameMapper,
|
||||
targetConnectionId: detail.configuration.targetConnectionId,
|
||||
targetDropTable: detail.configuration.targetDropTable,
|
||||
targetOnlyCreate: detail.configuration.targetOnlyCreate,
|
||||
targetSchema: detail.configuration.targetSchema,
|
||||
batchSize: detail.configuration.batchSize
|
||||
}
|
||||
@@ -792,6 +813,7 @@ export default {
|
||||
tableNameMapper: this.updateform.tableNameMapper,
|
||||
columnNameMapper: this.updateform.columnNameMapper,
|
||||
targetDropTable: true,
|
||||
targetOnlyCreate: this.updateform.targetOnlyCreate,
|
||||
batchSize: this.updateform.batchSize
|
||||
}
|
||||
})
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-admin</artifactId>
|
||||
|
@@ -49,6 +49,7 @@ public class AssignmentDetailConverter extends
|
||||
config.setTargetConnectionId(dstConn.getId());
|
||||
config.setTargetConnectionName(dstConn.getName());
|
||||
config.setTargetSchema(taskConfig.getTargetSchema());
|
||||
config.setTargetOnlyCreate(taskConfig.getTargetOnlyCreate());
|
||||
config.setTableNameMapper(taskConfig.getTableNameMap());
|
||||
config.setColumnNameMapper(taskConfig.getColumnNameMap());
|
||||
config.setBatchSize(taskConfig.getBatchSize());
|
||||
|
@@ -67,6 +67,9 @@ public class AssignmentConfigEntity {
|
||||
@Column(name = "target_drop_table")
|
||||
private Boolean targetDropTable;
|
||||
|
||||
@Column(name = "target_only_create")
|
||||
private Boolean targetOnlyCreate;
|
||||
|
||||
@Column(name = "batch_size")
|
||||
private Integer batchSize;
|
||||
|
||||
|
@@ -48,6 +48,7 @@ public class AssigmentCreateRequest {
|
||||
private List<PatternMapper> tableNameMapper;
|
||||
private List<PatternMapper> columnNameMapper;
|
||||
private Boolean targetDropTable;
|
||||
private Boolean targetOnlyCreate;
|
||||
private Integer batchSize;
|
||||
}
|
||||
|
||||
@@ -83,6 +84,7 @@ public class AssigmentCreateRequest {
|
||||
assignmentConfigEntity.setTableNameMap(this.getConfig().getTableNameMapper());
|
||||
assignmentConfigEntity.setColumnNameMap(this.getConfig().getColumnNameMapper());
|
||||
assignmentConfigEntity.setTargetDropTable(this.getConfig().getTargetDropTable());
|
||||
assignmentConfigEntity.setTargetOnlyCreate(this.getConfig().getTargetOnlyCreate());
|
||||
assignmentConfigEntity.setBatchSize(
|
||||
Objects.isNull(this.config.getBatchSize())
|
||||
? 10000
|
||||
|
@@ -46,6 +46,7 @@ public class AssigmentUpdateRequest {
|
||||
private List<PatternMapper> tableNameMapper;
|
||||
private List<PatternMapper> columnNameMapper;
|
||||
private Boolean targetDropTable;
|
||||
private Boolean targetOnlyCreate;
|
||||
private Integer batchSize;
|
||||
}
|
||||
|
||||
@@ -81,6 +82,7 @@ public class AssigmentUpdateRequest {
|
||||
assignmentConfigEntity.setTableNameMap(this.getConfig().getTableNameMapper());
|
||||
assignmentConfigEntity.setColumnNameMap(this.getConfig().getColumnNameMapper());
|
||||
assignmentConfigEntity.setTargetDropTable(this.getConfig().getTargetDropTable());
|
||||
assignmentConfigEntity.setTargetOnlyCreate(this.getConfig().getTargetOnlyCreate());
|
||||
assignmentConfigEntity.setBatchSize(
|
||||
Objects.isNull(this.config.getBatchSize())
|
||||
? 10000
|
||||
|
@@ -83,6 +83,9 @@ public class AssignmentDetailResponse {
|
||||
@ApiModelProperty("目的端数据源的Schema")
|
||||
private String targetSchema;
|
||||
|
||||
@ApiModelProperty("是否只建表")
|
||||
private Boolean targetOnlyCreate;
|
||||
|
||||
@ApiModelProperty("表名映射关系")
|
||||
private List<PatternMapper> tableNameMapper;
|
||||
|
||||
|
@@ -251,6 +251,9 @@ public class AssignmentService {
|
||||
targetDataSourceProperties.setTargetDrop(Boolean.FALSE);
|
||||
targetDataSourceProperties.setChangeDataSync(Boolean.TRUE);
|
||||
}
|
||||
if(assignmentConfigEntity.getTargetOnlyCreate()) {
|
||||
targetDataSourceProperties.setOnlyCreate(Boolean.TRUE);
|
||||
}
|
||||
|
||||
return targetDataSourceProperties;
|
||||
}
|
||||
|
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `DBSWITCH_ASSIGNMENT_CONFIG`
|
||||
ADD COLUMN `target_only_create` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否只建表' AFTER `target_drop_table`;
|
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>异构数据迁移工具</title><link href=/static/css/app.bc83f5316094e8a72597c94a4443f6b3.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.80c42f725fd3b643f80d.js></script><script type=text/javascript src=/static/js/vendor.d6c2f50c2f02bf33c8cf.js></script><script type=text/javascript src=/static/js/app.2dd7015ae4fe3dd7fe2e.js></script></body></html>
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>异构数据迁移工具</title><link href=/static/css/app.b3378b34adc1e2ea16f5864d0330a4ea.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.feed98e3dd9fb57fcb68.js></script><script type=text/javascript src=/static/js/vendor.d6c2f50c2f02bf33c8cf.js></script><script type=text/javascript src=/static/js/app.bd883e8c290338935864.js></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
webpackJsonp([15],{HH4r:function(t,e){},oQRv:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={data:function(){return{loading:!0,lists:[],currentPage:1,pageSize:10,totalCount:0}},methods:{loadData:function(){var t=this;this.$http.get("/dbswitch/admin/api/v1/syslog/list/1/"+this.currentPage+"/"+this.pageSize).then(function(e){t.loading=!1,0===e.data.code?(t.currentPage=e.data.pagination.page,t.pageSize=e.data.pagination.size,t.totalCount=e.data.pagination.total,t.lists=e.data.data):alert("加载数据失败:"+e.data.message)},function(e){t.$message({showClose:!0,message:"数据加载错误",type:"error"})})},handleSizeChange:function(t){this.loading=!0,this.pageSize=t,this.loadData()},handleCurrentChange:function(t){this.loading=!0,this.currentPage=t,this.loadData()}},created:function(){this.loadData()}},i={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{"margin-top":"15px"}},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{"element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.8)",data:t.lists,stripe:"",size:"small",border:""}},[a("el-table-column",{attrs:{prop:"createTime",label:"日志时间","min-width":"15%","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"ipAddress",label:"请求IP","min-width":"10%","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"content",label:"操作内容","min-width":"20%","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"userAgent",label:"请求代理","min-width":"50%","show-overflow-tooltip":!0}})],1),t._v(" "),a("div",{staticClass:"page",attrs:{align:"right"}},[a("el-pagination",{attrs:{"current-page":t.currentPage,"page-sizes":[5,10,20,40],"page-size":t.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.totalCount},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var o=a("VU/8")(n,i,!1,function(t){a("HH4r")},"data-v-1bc640ee",null);e.default=o.exports}});
|
||||
//# sourceMappingURL=15.dec790aca8fa0a8e930a.js.map
|
||||
webpackJsonp([14],{HH4r:function(t,e){},oQRv:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={data:function(){return{loading:!0,lists:[],currentPage:1,pageSize:10,totalCount:0}},methods:{loadData:function(){var t=this;this.$http.get("/dbswitch/admin/api/v1/syslog/list/1/"+this.currentPage+"/"+this.pageSize).then(function(e){t.loading=!1,0===e.data.code?(t.currentPage=e.data.pagination.page,t.pageSize=e.data.pagination.size,t.totalCount=e.data.pagination.total,t.lists=e.data.data):alert("加载数据失败:"+e.data.message)},function(e){t.$message({showClose:!0,message:"数据加载错误",type:"error"})})},handleSizeChange:function(t){this.loading=!0,this.pageSize=t,this.loadData()},handleCurrentChange:function(t){this.loading=!0,this.currentPage=t,this.loadData()}},created:function(){this.loadData()}},i={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{"margin-top":"15px"}},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{"element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.8)",data:t.lists,stripe:"",size:"small",border:""}},[a("el-table-column",{attrs:{prop:"createTime",label:"日志时间","min-width":"15%","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"ipAddress",label:"请求IP","min-width":"10%","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"content",label:"操作内容","min-width":"20%","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"userAgent",label:"请求代理","min-width":"50%","show-overflow-tooltip":!0}})],1),t._v(" "),a("div",{staticClass:"page",attrs:{align:"right"}},[a("el-pagination",{attrs:{"current-page":t.currentPage,"page-sizes":[5,10,20,40],"page-size":t.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.totalCount},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var o=a("VU/8")(n,i,!1,function(t){a("HH4r")},"data-v-1bc640ee",null);e.default=o.exports}});
|
||||
//# sourceMappingURL=14.220c10d64f09655e8973.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
webpackJsonp([17],{NHnr:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=t("//Fk"),r=t.n(o),a=t("7+uW"),u={render:function(){var n=this.$createElement,e=this._self._c||n;return e("div",{staticClass:"body-wrapper"},[e("router-view")],1)},staticRenderFns:[]};var c=t("VU/8")({name:"App"},u,!1,function(n){t("Pibb")},"data-v-a97617c2",null).exports,i=t("/ocq");a.default.use(i.a);var l=new i.a({routes:[{path:"/",name:"首页",component:function(){return t.e(4).then(t.bind(null,"4er+"))},redirect:"/dashboard",children:[{path:"/dashboard",name:"概览",icon:"el-icon-menu",component:function(){return Promise.all([t.e(0),t.e(8)]).then(t.bind(null,"ARoL"))}},{path:"/connection",name:"连接管理",icon:"el-icon-s-order",component:function(){return Promise.all([t.e(0),t.e(12)]).then(t.bind(null,"qdtB"))}},{path:"/metadata",name:"数据目录",icon:"el-icon-coin",component:function(){return t.e(1).then(t.bind(null,"PJ2q"))}},{path:"/task",name:"任务管理",icon:"el-icon-s-tools",component:function(){return t.e(6).then(t.bind(null,"4KEO"))},children:[{path:"/task/assignment",name:"任务安排",icon:"el-icon-eleme",component:function(){return Promise.all([t.e(0),t.e(14)]).then(t.bind(null,"D0I9"))}},{path:"/task/schedule",name:"调度记录",icon:"el-icon-pie-chart",component:function(){return t.e(13).then(t.bind(null,"mKp/"))}}]},{path:"/log",name:"审计日志",icon:"el-icon-platform-eleme",component:function(){return t.e(7).then(t.bind(null,"QWih"))},children:[{path:"/log/access",name:"登录日志",icon:"el-icon-eleme",component:function(){return t.e(15).then(t.bind(null,"oQRv"))}},{path:"/log/action",name:"操作日志",icon:"el-icon-s-check",component:function(){return t.e(10).then(t.bind(null,"0eSS"))}}]},{path:"/about",name:"关于系统",icon:"el-icon-s-custom",component:function(){return t.e(2).then(t.bind(null,"m25N"))}},{path:"/user/personal",name:"个人中心",hidden:!0,component:function(){return t.e(3).then(t.bind(null,"uTKz"))}},{path:"/task/create",name:"创建任务",hidden:!0,component:function(){return Promise.all([t.e(0),t.e(11)]).then(t.bind(null,"/rCC"))}},{path:"/task/update",name:"修改任务",hidden:!0,component:function(){return Promise.all([t.e(0),t.e(9)]).then(t.bind(null,"txod"))}}]},{path:"/login",name:"登录",component:function(){return t.e(5).then(t.bind(null,"T+/8"))}}]}),p=t("mtWM"),s=t.n(p).a.create();s.interceptors.request.use(function(n){return n.url=""+n.url,n});var d=s,m=t("zL8q"),h=t.n(m),f=(t("muQq"),t("tvR6"),t("7Vno")),b=t.n(f),v=t("XLwt"),g=t.n(v);a.default.use(d),a.default.use(h.a),a.default.use(b.a),a.default.prototype.$http=d,a.default.config.productionTip=!1,a.default.prototype.$echarts=g.a,d.interceptors.request.use(function(n){var e=sessionStorage.getItem("token");return e&&(n.headers.Authorization="Bearer "+e),n},function(n){return r.a.reject(n)}),d.interceptors.response.use(function(n){return!n.data||401!==n.data.code&&403!==n.data.code&&404!==n.data.code||l.push({path:"/login"}),n},function(n){return console.log(n),r.a.reject(n.response)}),new a.default({el:"#app",router:l,components:{App:c},template:"<App/>"})},Pibb:function(n,e){},muQq:function(n,e){},tvR6:function(n,e){}},["NHnr"]);
|
||||
//# sourceMappingURL=app.2dd7015ae4fe3dd7fe2e.js.map
|
||||
webpackJsonp([17],{NHnr:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=t("//Fk"),r=t.n(o),a=t("7+uW"),u={render:function(){var n=this.$createElement,e=this._self._c||n;return e("div",{staticClass:"body-wrapper"},[e("router-view")],1)},staticRenderFns:[]};var c=t("VU/8")({name:"App"},u,!1,function(n){t("Pibb")},"data-v-a97617c2",null).exports,i=t("/ocq");a.default.use(i.a);var l=new i.a({routes:[{path:"/",name:"首页",component:function(){return t.e(4).then(t.bind(null,"4er+"))},redirect:"/dashboard",children:[{path:"/dashboard",name:"概览",icon:"el-icon-menu",component:function(){return Promise.all([t.e(0),t.e(8)]).then(t.bind(null,"ARoL"))}},{path:"/connection",name:"连接管理",icon:"el-icon-s-order",component:function(){return Promise.all([t.e(0),t.e(11)]).then(t.bind(null,"qdtB"))}},{path:"/metadata",name:"数据目录",icon:"el-icon-coin",component:function(){return t.e(1).then(t.bind(null,"PJ2q"))}},{path:"/task",name:"任务管理",icon:"el-icon-s-tools",component:function(){return t.e(6).then(t.bind(null,"4KEO"))},children:[{path:"/task/assignment",name:"任务安排",icon:"el-icon-eleme",component:function(){return Promise.all([t.e(0),t.e(13)]).then(t.bind(null,"D0I9"))}},{path:"/task/schedule",name:"调度记录",icon:"el-icon-pie-chart",component:function(){return t.e(12).then(t.bind(null,"mKp/"))}}]},{path:"/log",name:"审计日志",icon:"el-icon-platform-eleme",component:function(){return t.e(7).then(t.bind(null,"QWih"))},children:[{path:"/log/access",name:"登录日志",icon:"el-icon-eleme",component:function(){return t.e(14).then(t.bind(null,"oQRv"))}},{path:"/log/action",name:"操作日志",icon:"el-icon-s-check",component:function(){return t.e(10).then(t.bind(null,"0eSS"))}}]},{path:"/about",name:"关于系统",icon:"el-icon-s-custom",component:function(){return t.e(2).then(t.bind(null,"m25N"))}},{path:"/user/personal",name:"个人中心",hidden:!0,component:function(){return t.e(3).then(t.bind(null,"uTKz"))}},{path:"/task/create",name:"创建任务",hidden:!0,component:function(){return Promise.all([t.e(0),t.e(9)]).then(t.bind(null,"/rCC"))}},{path:"/task/update",name:"修改任务",hidden:!0,component:function(){return Promise.all([t.e(0),t.e(15)]).then(t.bind(null,"txod"))}}]},{path:"/login",name:"登录",component:function(){return t.e(5).then(t.bind(null,"T+/8"))}}]}),p=t("mtWM"),s=t.n(p).a.create();s.interceptors.request.use(function(n){return n.url=""+n.url,n});var d=s,m=t("zL8q"),h=t.n(m),f=(t("muQq"),t("tvR6"),t("7Vno")),b=t.n(f),v=t("XLwt"),g=t.n(v);a.default.use(d),a.default.use(h.a),a.default.use(b.a),a.default.prototype.$http=d,a.default.config.productionTip=!1,a.default.prototype.$echarts=g.a,d.interceptors.request.use(function(n){var e=sessionStorage.getItem("token");return e&&(n.headers.Authorization="Bearer "+e),n},function(n){return r.a.reject(n)}),d.interceptors.response.use(function(n){return!n.data||401!==n.data.code&&403!==n.data.code&&404!==n.data.code||l.push({path:"/login"}),n},function(n){return console.log(n),r.a.reject(n.response)}),new a.default({el:"#app",router:l,components:{App:c},template:"<App/>"})},Pibb:function(n,e){},muQq:function(n,e){},tvR6:function(n,e){}},["NHnr"]);
|
||||
//# sourceMappingURL=app.bd883e8c290338935864.js.map
|
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,o,c){for(var f,d,i,u=0,s=[];u<r.length;u++)d=r[u],t[d]&&s.push(t[d][0]),t[d]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(n&&n(r,o,c);s.length;)s.shift()();if(c)for(u=0;u<c.length;u++)i=a(a.s=c[u]);return i};var r={},t={18:0};function a(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,a){n=t[e]=[r,a]});n[2]=r;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+e+"."+{0:"ca67e87d8c000a42e592",1:"bd90a7e98064156140b6",2:"45757fdd22b0c905f12a",3:"d4c1dc7b68edb49b61d2",4:"c4abd62fbe15189d37a5",5:"837a4a67f1fcf6ee6c6a",6:"7f56c2238fb7e4ee2ecd",7:"d5dc80a855f66a3208ff",8:"2bf951413fb931374230",9:"729e286f79df81fea7d3",10:"ec3b8253b1c336df3447",11:"698a50794af7c9a68ca6",12:"5d3ab6a26a8047df4873",13:"eaa4da512adb13b7d4fd",14:"cadc6af4835efe7c42e4",15:"dec790aca8fa0a8e930a"}[e]+".js";var f=setTimeout(d,12e4);function d(){c.onerror=c.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=d,o.appendChild(c),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="/",a.oe=function(e){throw console.error(e),e}}([]);
|
||||
//# sourceMappingURL=manifest.80c42f725fd3b643f80d.js.map
|
@@ -0,0 +1,2 @@
|
||||
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,f){for(var a,d,i,u=0,b=[];u<r.length;u++)d=r[u],t[d]&&b.push(t[d][0]),t[d]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(n&&n(r,c,f);b.length;)b.shift()();if(f)for(u=0;u<f.length;u++)i=o(o.s=f[u]);return i};var r={},t={18:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,o.nc&&f.setAttribute("nonce",o.nc),f.src=o.p+"static/js/"+e+"."+{0:"ca67e87d8c000a42e592",1:"bd90a7e98064156140b6",2:"45757fdd22b0c905f12a",3:"d4c1dc7b68edb49b61d2",4:"c4abd62fbe15189d37a5",5:"837a4a67f1fcf6ee6c6a",6:"7f56c2238fb7e4ee2ecd",7:"d5dc80a855f66a3208ff",8:"2bf951413fb931374230",9:"51471fff489d5c840717",10:"ec3b8253b1c336df3447",11:"313c152f4354145af7b5",12:"eb5401eb22c55db52cd0",13:"bdcf7e684437edab125f",14:"220c10d64f09655e8973",15:"60356d680f753f10fcdd"}[e]+".js";var a=setTimeout(d,12e4);function d(){f.onerror=f.onload=null,clearTimeout(a);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return f.onerror=f.onload=d,c.appendChild(f),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="/",o.oe=function(e){throw console.error(e),e}}([]);
|
||||
//# sourceMappingURL=manifest.feed98e3dd9fb57fcb68.js.map
|
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-common</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-core</artifactId>
|
||||
|
@@ -70,7 +70,7 @@ public interface IDatabaseInterface {
|
||||
*
|
||||
* @param connection JDBC连接
|
||||
* @param schemaName 模式名称
|
||||
* @param tableName 表或视图名称
|
||||
* @param tableName 表名称
|
||||
* @return 字段元信息列表
|
||||
*/
|
||||
String getTableDDL(Connection connection, String schemaName, String tableName);
|
||||
@@ -158,13 +158,15 @@ public interface IDatabaseInterface {
|
||||
/**
|
||||
* 获取字段列的结构定义
|
||||
*
|
||||
* @param v 值元数据定义
|
||||
* @param pks 主键字段名称列表
|
||||
* @param addCr 是否结尾换行
|
||||
* @param useAutoInc 是否自增
|
||||
* @param v 值元数据定义
|
||||
* @param pks 主键字段名称列表
|
||||
* @param addCr 是否结尾换行
|
||||
* @param useAutoInc 是否自增
|
||||
* @param withRemarks 是否带有注释
|
||||
* @return 字段定义字符串
|
||||
*/
|
||||
String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc, boolean addCr);
|
||||
String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc, boolean addCr,
|
||||
boolean withRemarks);
|
||||
|
||||
/**
|
||||
* 主键列转换为逗号分隔的字符串
|
||||
@@ -173,4 +175,13 @@ public interface IDatabaseInterface {
|
||||
* @return 主键字段拼接串
|
||||
*/
|
||||
String getPrimaryKeyAsString(List<String> pks);
|
||||
|
||||
/**
|
||||
* 获取表和字段的注释定义
|
||||
*
|
||||
* @param td 表信息定义
|
||||
* @param cds 列信息定义
|
||||
* @return 定义字符串列表
|
||||
*/
|
||||
List<String> getTableColumnCommentDefinition(TableDescription td, List<ColumnDescription> cds);
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ import com.gitee.dbswitch.core.database.AbstractDatabase;
|
||||
import com.gitee.dbswitch.core.database.IDatabaseInterface;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
@@ -23,6 +24,7 @@ import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 支持DB2数据库的元信息实现
|
||||
@@ -122,7 +124,7 @@ public class DatabaseDB2Impl extends AbstractDatabase implements IDatabaseInterf
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -216,4 +218,27 @@ public class DatabaseDB2Impl extends AbstractDatabase implements IDatabaseInterf
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON TABLE \"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(),
|
||||
td.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON COLUMN \"%s\".\"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(), cd.getFieldName(),
|
||||
cd.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,11 +15,14 @@ import com.gitee.dbswitch.core.database.AbstractDatabase;
|
||||
import com.gitee.dbswitch.core.database.IDatabaseInterface;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 支持DM数据库的元信息实现
|
||||
@@ -98,7 +101,7 @@ public class DatabaseDmImpl extends AbstractDatabase implements IDatabaseInterfa
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -164,4 +167,27 @@ public class DatabaseDmImpl extends AbstractDatabase implements IDatabaseInterfa
|
||||
return retval.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON TABLE \"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(),
|
||||
td.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON COLUMN \"%s\".\"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(), cd.getFieldName(),
|
||||
cd.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,14 +16,18 @@ import com.gitee.dbswitch.core.database.IDatabaseInterface;
|
||||
import com.gitee.dbswitch.core.database.constant.PostgresqlConst;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import com.gitee.dbswitch.core.util.PostgresUtils;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 支持Greenplum数据库的元信息实现
|
||||
@@ -77,11 +81,10 @@ public class DatabaseGreenplumImpl extends AbstractDatabase implements IDatabase
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
//throw new RuntimeException(e);
|
||||
// TODO: Greenplum的表的DDL获取方法
|
||||
return e.getMessage();
|
||||
}
|
||||
|
||||
return null;
|
||||
// 低版本的PostgreSQL的表的DDL获取方法
|
||||
return PostgresUtils.getTableDDL(connection, schemaName, tableName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,7 +123,7 @@ public class DatabaseGreenplumImpl extends AbstractDatabase implements IDatabase
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -201,4 +204,27 @@ public class DatabaseGreenplumImpl extends AbstractDatabase implements IDatabase
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON TABLE \"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(),
|
||||
td.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON COLUMN \"%s\".\"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(), cd.getFieldName(),
|
||||
cd.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ import com.gitee.dbswitch.core.database.AbstractDatabase;
|
||||
import com.gitee.dbswitch.core.database.IDatabaseInterface;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
@@ -25,6 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class DatabaseHiveImpl extends AbstractDatabase implements IDatabaseInterface {
|
||||
|
||||
@@ -154,7 +156,7 @@ public class DatabaseHiveImpl extends AbstractDatabase implements IDatabaseInter
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int type = v.getType();
|
||||
|
||||
@@ -191,6 +193,10 @@ public class DatabaseHiveImpl extends AbstractDatabase implements IDatabaseInter
|
||||
break;
|
||||
}
|
||||
|
||||
if (withRemarks && StringUtils.isNotBlank(v.getRemarks())) {
|
||||
retval += String.format(" COMMENT '%s' ", v.getRemarks().replace("'", "\\'"));
|
||||
}
|
||||
|
||||
if (addCr) {
|
||||
retval += Const.CR;
|
||||
}
|
||||
@@ -198,4 +204,10 @@ public class DatabaseHiveImpl extends AbstractDatabase implements IDatabaseInter
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,11 +16,14 @@ import com.gitee.dbswitch.core.database.IDatabaseInterface;
|
||||
import com.gitee.dbswitch.core.database.constant.PostgresqlConst;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 支持Kingbase数据库的元信息实现
|
||||
@@ -99,7 +102,7 @@ public class DatabaseKingbaseImpl extends AbstractDatabase implements IDatabaseI
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -180,4 +183,28 @@ public class DatabaseKingbaseImpl extends AbstractDatabase implements IDatabaseI
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON TABLE \"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(),
|
||||
td.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON COLUMN \"%s\".\"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(), cd.getFieldName(),
|
||||
cd.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@@ -161,7 +162,7 @@ public class DatabaseMysqlImpl extends AbstractDatabase implements IDatabaseInte
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -257,6 +258,10 @@ public class DatabaseMysqlImpl extends AbstractDatabase implements IDatabaseInte
|
||||
break;
|
||||
}
|
||||
|
||||
if (withRemarks && StringUtils.isNotBlank(v.getRemarks())) {
|
||||
retval += String.format(" COMMENT '%s' ", v.getRemarks().replace("'", "\\'"));
|
||||
}
|
||||
|
||||
if (addCr) {
|
||||
retval += Const.CR;
|
||||
}
|
||||
@@ -277,4 +282,10 @@ public class DatabaseMysqlImpl extends AbstractDatabase implements IDatabaseInte
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,8 +23,10 @@ import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 支持Oracle数据库的元信息实现
|
||||
@@ -167,7 +169,7 @@ public class DatabaseOracleImpl extends AbstractDatabase implements IDatabaseInt
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -234,4 +236,27 @@ public class DatabaseOracleImpl extends AbstractDatabase implements IDatabaseInt
|
||||
return retval.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON TABLE \"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(),
|
||||
td.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON COLUMN \"%s\".\"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(), cd.getFieldName(),
|
||||
cd.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,15 +16,19 @@ import com.gitee.dbswitch.core.database.IDatabaseInterface;
|
||||
import com.gitee.dbswitch.core.database.constant.PostgresqlConst;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import com.gitee.dbswitch.core.util.DDLFormatterUtils;
|
||||
import com.gitee.dbswitch.core.util.PostgresUtils;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 支持PostgreSQL数据库的元信息实现
|
||||
@@ -81,11 +85,10 @@ public class DatabasePostgresImpl extends AbstractDatabase implements IDatabaseI
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
//throw new RuntimeException(e);
|
||||
// 低版本的PostgreSQL的表的DDL获取方法
|
||||
return e.getMessage();
|
||||
}
|
||||
|
||||
return null;
|
||||
// 低版本的PostgreSQL的表的DDL获取方法
|
||||
return PostgresUtils.getTableDDL(connection, schemaName, tableName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +138,7 @@ public class DatabasePostgresImpl extends AbstractDatabase implements IDatabaseI
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -217,4 +220,27 @@ public class DatabasePostgresImpl extends AbstractDatabase implements IDatabaseI
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON TABLE \"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(),
|
||||
td.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format("COMMENT ON COLUMN \"%s\".\"%s\".\"%s\" IS '%s' ",
|
||||
td.getSchemaName(), td.getTableName(), cd.getFieldName(),
|
||||
cd.getRemarks().replace("\"", "\\\"")));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -219,7 +219,7 @@ public class DatabaseSqlserverImpl extends AbstractDatabase implements IDatabase
|
||||
|
||||
@Override
|
||||
public String getFieldDefinition(ColumnMetaData v, List<String> pks, boolean useAutoInc,
|
||||
boolean addCr) {
|
||||
boolean addCr, boolean withRemarks) {
|
||||
String fieldname = v.getName();
|
||||
int length = v.getLength();
|
||||
int precision = v.getPrecision();
|
||||
@@ -314,4 +314,28 @@ public class DatabaseSqlserverImpl extends AbstractDatabase implements IDatabase
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTableColumnCommentDefinition(TableDescription td,
|
||||
List<ColumnDescription> cds) {
|
||||
List<String> results = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(td.getRemarks())) {
|
||||
results.add(String
|
||||
.format(
|
||||
"EXEC [sys].sp_addextendedproperty 'MS_Description', N'%s', 'schema', N'%s', 'table', N'%s' ",
|
||||
td.getRemarks().replace("\"", "\\\""), td.getSchemaName(), td.getTableName()));
|
||||
}
|
||||
|
||||
for (ColumnDescription cd : cds) {
|
||||
if (StringUtils.isNotBlank(cd.getRemarks())) {
|
||||
results.add(String
|
||||
.format(
|
||||
"EXEC [sys].sp_addextendedproperty 'MS_Description', N'%s', 'schema', N'%s', 'table', N'%s', 'column', N'%s' ",
|
||||
cd.getRemarks().replace("\"", "\\\""), td.getSchemaName(), td.getTableName(),
|
||||
cd.getFieldName()));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -96,6 +96,7 @@ public class ColumnMetaData {
|
||||
protected int length;
|
||||
protected int precision;
|
||||
protected int type;
|
||||
protected String remarks;
|
||||
|
||||
/**
|
||||
* Constructor function
|
||||
@@ -138,6 +139,14 @@ public class ColumnMetaData {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not the value is a String.
|
||||
*
|
||||
@@ -455,6 +464,7 @@ public class ColumnMetaData {
|
||||
this.length = length;
|
||||
this.precision = precision;
|
||||
this.type = valtype;
|
||||
this.remarks = desc.getRemarks();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -41,6 +41,15 @@ public interface IMetaDataByDatasourceService {
|
||||
*/
|
||||
String getTableDDL(String schemaName, String tableName);
|
||||
|
||||
/**
|
||||
* 获取物理表的注释
|
||||
*
|
||||
* @param schemaName 模式名称
|
||||
* @param tableName 表名称
|
||||
* @return
|
||||
*/
|
||||
String getTableRemark(String schemaName, String tableName);
|
||||
|
||||
/**
|
||||
* 获取物理表的DDL建表语句
|
||||
*
|
||||
@@ -122,6 +131,7 @@ public interface IMetaDataByDatasourceService {
|
||||
* @param autoIncr 是否允许主键自增
|
||||
* @return 对应数据库的DDL建表语句
|
||||
*/
|
||||
String getDDLCreateTableSQL(DatabaseTypeEnum type, List<ColumnDescription> fieldNames,
|
||||
List<String> primaryKeys, String schemaName, String tableName, boolean autoIncr);
|
||||
List<String> getDDLCreateTableSQL(DatabaseTypeEnum type, List<ColumnDescription> fieldNames,
|
||||
List<String> primaryKeys, String schemaName, String tableName, String tableRemarks,
|
||||
boolean autoIncr);
|
||||
}
|
||||
|
@@ -77,6 +77,16 @@ public class MetaDataByDataSourceServiceImpl implements IMetaDataByDatasourceSer
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableRemark(String schemaName, String tableName) {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
TableDescription td = database.queryTableMeta(connection, schemaName, tableName);
|
||||
return null == td ? null : td.getRemarks();
|
||||
} catch (SQLException se) {
|
||||
throw new RuntimeException(se);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getViewDDL(String schemaName, String tableName) {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
@@ -178,10 +188,11 @@ public class MetaDataByDataSourceServiceImpl implements IMetaDataByDatasourceSer
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDDLCreateTableSQL(DatabaseTypeEnum type, List<ColumnDescription> fieldNames,
|
||||
List<String> primaryKeys, String schemaName, String tableName, boolean autoIncr) {
|
||||
public List<String> getDDLCreateTableSQL(DatabaseTypeEnum type,
|
||||
List<ColumnDescription> fieldNames, List<String> primaryKeys, String schemaName,
|
||||
String tableName, String tableRemarks, boolean autoIncr) {
|
||||
return GenerateSqlUtils.getDDLCreateTableSQL(
|
||||
type, fieldNames, primaryKeys, schemaName, tableName, autoIncr);
|
||||
type, fieldNames, primaryKeys, schemaName, tableName, tableRemarks, autoIncr);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,8 +15,11 @@ import com.gitee.dbswitch.core.database.AbstractDatabase;
|
||||
import com.gitee.dbswitch.core.database.DatabaseFactory;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import com.gitee.dbswitch.core.model.ColumnMetaData;
|
||||
import com.gitee.dbswitch.core.model.TableDescription;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 拼接SQL工具类
|
||||
@@ -32,14 +35,34 @@ public class GenerateSqlUtils {
|
||||
String schemaName,
|
||||
String tableName,
|
||||
boolean autoIncr) {
|
||||
AbstractDatabase db = DatabaseFactory.getDatabaseInstance(type);
|
||||
return getDDLCreateTableSQL(
|
||||
db,
|
||||
fieldNames,
|
||||
primaryKeys,
|
||||
schemaName,
|
||||
tableName,
|
||||
false,
|
||||
null,
|
||||
autoIncr);
|
||||
}
|
||||
|
||||
public static String getDDLCreateTableSQL(
|
||||
AbstractDatabase db,
|
||||
List<ColumnDescription> fieldNames,
|
||||
List<String> primaryKeys,
|
||||
String schemaName,
|
||||
String tableName,
|
||||
boolean withRemarks,
|
||||
String tableRemarks,
|
||||
boolean autoIncr) {
|
||||
DatabaseTypeEnum type = db.getDatabaseType();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
List<String> pks = fieldNames.stream()
|
||||
.filter((cd) -> primaryKeys.contains(cd.getFieldName()))
|
||||
.map((cd) -> cd.getFieldName())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
AbstractDatabase db = DatabaseFactory.getDatabaseInstance(type);
|
||||
|
||||
sb.append(Const.CREATE_TABLE);
|
||||
// if(ifNotExist && type!=DatabaseType.ORACLE) {
|
||||
// sb.append( Const.IF_NOT_EXISTS );
|
||||
@@ -55,7 +78,7 @@ public class GenerateSqlUtils {
|
||||
}
|
||||
|
||||
ColumnMetaData v = fieldNames.get(i).getMetaData();
|
||||
sb.append(db.getFieldDefinition(v, pks, autoIncr, false));
|
||||
sb.append(db.getFieldDefinition(v, pks, autoIncr, false, withRemarks));
|
||||
}
|
||||
|
||||
if (!pks.isEmpty()) {
|
||||
@@ -66,8 +89,37 @@ public class GenerateSqlUtils {
|
||||
sb.append(")");
|
||||
if (DatabaseTypeEnum.MYSQL == type) {
|
||||
sb.append("ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin");
|
||||
if (withRemarks && StringUtils.isNotBlank(tableRemarks)) {
|
||||
sb.append(String.format(" COMMENT='%s' ", tableRemarks.replace("'", "\\'")));
|
||||
}
|
||||
}
|
||||
|
||||
return DDLFormatterUtils.format(sb.toString());
|
||||
}
|
||||
|
||||
public static List<String> getDDLCreateTableSQL(
|
||||
DatabaseTypeEnum type,
|
||||
List<ColumnDescription> fieldNames,
|
||||
List<String> primaryKeys,
|
||||
String schemaName,
|
||||
String tableName,
|
||||
String tableRemarks,
|
||||
boolean autoIncr) {
|
||||
AbstractDatabase db = DatabaseFactory.getDatabaseInstance(type);
|
||||
String createTableSql = getDDLCreateTableSQL(db, fieldNames, primaryKeys, schemaName,
|
||||
tableName, true, tableRemarks, autoIncr);
|
||||
if (DatabaseTypeEnum.MYSQL == type || DatabaseTypeEnum.HIVE == type) {
|
||||
return Arrays.asList(createTableSql);
|
||||
}
|
||||
|
||||
TableDescription td = new TableDescription();
|
||||
td.setSchemaName(schemaName);
|
||||
td.setTableName(tableName);
|
||||
td.setRemarks(tableRemarks);
|
||||
td.setTableType("TABLE");
|
||||
List<String> results = db.getTableColumnCommentDefinition(td, fieldNames);
|
||||
results.add(0, createTableSql);
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,22 @@
|
||||
package com.gitee.dbswitch.core.util;
|
||||
|
||||
import com.gitee.dbswitch.common.type.DatabaseTypeEnum;
|
||||
import com.gitee.dbswitch.core.database.AbstractDatabase;
|
||||
import com.gitee.dbswitch.core.database.DatabaseFactory;
|
||||
import com.gitee.dbswitch.core.model.ColumnDescription;
|
||||
import java.sql.Connection;
|
||||
import java.util.List;
|
||||
|
||||
public final class PostgresUtils {
|
||||
|
||||
public static String getTableDDL(Connection connection, String schema, String table) {
|
||||
AbstractDatabase db = DatabaseFactory.getDatabaseInstance(DatabaseTypeEnum.POSTGRESQL);
|
||||
List<ColumnDescription> columnDescriptions = db.queryTableColumnMeta(connection, schema, table);
|
||||
List<String> pks = db.queryTablePrimaryKeys(connection, schema, table);
|
||||
return GenerateSqlUtils.getDDLCreateTableSQL(
|
||||
db.getDatabaseType(), columnDescriptions, pks, schema, table, false);
|
||||
}
|
||||
|
||||
private PostgresUtils() {
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-data</artifactId>
|
||||
|
@@ -24,6 +24,7 @@ public class TargetDataSourceProperties {
|
||||
|
||||
private String targetSchema = "";
|
||||
private Boolean targetDrop = Boolean.TRUE;
|
||||
private Boolean onlyCreate = Boolean.FALSE;
|
||||
private Boolean createTableAutoIncrement = Boolean.FALSE;
|
||||
private Boolean writerEngineInsert = Boolean.FALSE;
|
||||
private Boolean changeDataSync = Boolean.FALSE;
|
||||
|
@@ -57,7 +57,7 @@ import org.springframework.util.StringUtils;
|
||||
@Slf4j
|
||||
public class MigrationHandler implements Supplier<Long> {
|
||||
|
||||
private final long MAX_CACHE_BYTES_SIZE = 64 * 1024 * 1024;
|
||||
private final long MAX_CACHE_BYTES_SIZE = 128 * 1024 * 1024;
|
||||
|
||||
private int fetchSize = 100;
|
||||
private final DbswichProperties properties;
|
||||
@@ -68,6 +68,7 @@ public class MigrationHandler implements Supplier<Long> {
|
||||
private DatabaseTypeEnum sourceProductType;
|
||||
private String sourceSchemaName;
|
||||
private String sourceTableName;
|
||||
private String sourceTableRemarks;
|
||||
private List<ColumnDescription> sourceColumnDescriptions;
|
||||
private List<String> sourcePrimaryKeys;
|
||||
|
||||
@@ -127,7 +128,9 @@ public class MigrationHandler implements Supplier<Long> {
|
||||
this.sourceMetaDataService = new MetaDataByDataSourceServiceImpl(sourceDataSource,
|
||||
sourceProductType);
|
||||
|
||||
// 读取源表的字段元数据
|
||||
// 读取源表的表及字段元数据
|
||||
this.sourceTableRemarks = sourceMetaDataService
|
||||
.getTableRemark(sourceSchemaName, sourceTableName);
|
||||
this.sourceColumnDescriptions = sourceMetaDataService
|
||||
.queryTableColumnMeta(sourceSchemaName, sourceTableName);
|
||||
this.sourcePrimaryKeys = sourceMetaDataService
|
||||
@@ -188,7 +191,7 @@ public class MigrationHandler implements Supplier<Long> {
|
||||
}
|
||||
|
||||
// 生成建表语句并创建
|
||||
String sqlCreateTable = sourceMetaDataService.getDDLCreateTableSQL(
|
||||
List<String> sqlCreateTable = sourceMetaDataService.getDDLCreateTableSQL(
|
||||
targetProductType,
|
||||
targetColumnDescriptions.stream()
|
||||
.filter(column -> StringUtils.hasLength(column.getFieldName()))
|
||||
@@ -196,15 +199,30 @@ public class MigrationHandler implements Supplier<Long> {
|
||||
targetPrimaryKeys,
|
||||
targetSchemaName,
|
||||
targetTableName,
|
||||
sourceTableRemarks,
|
||||
properties.getTarget().getCreateTableAutoIncrement()
|
||||
);
|
||||
|
||||
JdbcTemplate targetJdbcTemplate = new JdbcTemplate(targetDataSource);
|
||||
targetJdbcTemplate.execute(sqlCreateTable);
|
||||
log.info("Execute SQL: \n{}", sqlCreateTable);
|
||||
for (String sql : sqlCreateTable) {
|
||||
targetJdbcTemplate.execute(sql);
|
||||
log.info("Execute SQL: \n{}", sql);
|
||||
}
|
||||
|
||||
// 如果只想创建表,这里直接返回
|
||||
if (null != properties.getTarget().getOnlyCreate()
|
||||
&& properties.getTarget().getOnlyCreate()) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
return doFullCoverSynchronize(writer);
|
||||
} else {
|
||||
// 对于只想创建表的情况,不提供后续的变化量数据同步功能
|
||||
if (null != properties.getTarget().getOnlyCreate()
|
||||
&& properties.getTarget().getOnlyCreate()) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
// 判断是否具备变化量同步的条件:(1)两端表结构一致,且都有一样的主键字段;(2)MySQL使用Innodb引擎;
|
||||
if (properties.getTarget().getChangeDataSync()) {
|
||||
// 根据主键情况判断同步的方式:增量同步或覆盖同步
|
||||
@@ -293,7 +311,8 @@ public class MigrationHandler implements Supplier<Long> {
|
||||
}
|
||||
|
||||
cache.add(record);
|
||||
cacheBytes += SizeOf.newInstance().deepSizeOf(record);
|
||||
long bytes = SizeOf.newInstance().deepSizeOf(record);
|
||||
cacheBytes += bytes;
|
||||
++totalCount;
|
||||
|
||||
if (cache.size() >= BATCH_SIZE || cacheBytes >= MAX_CACHE_BYTES_SIZE) {
|
||||
@@ -402,8 +421,9 @@ public class MigrationHandler implements Supplier<Long> {
|
||||
countDelete++;
|
||||
}
|
||||
|
||||
cacheBytes += SizeOf.newInstance().deepSizeOf(record);
|
||||
totalBytes.addAndGet(cacheBytes);
|
||||
long bytes = SizeOf.newInstance().deepSizeOf(record);
|
||||
cacheBytes += bytes;
|
||||
totalBytes.addAndGet(bytes);
|
||||
countTotal++;
|
||||
checkFull(fields);
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-dbchange</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-dbcommon</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-dbsynch</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-dbwriter</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-pgwriter</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dbswitch-sql</artifactId>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>package-tool</artifactId>
|
||||
|
@@ -21,7 +21,7 @@ set APP_LIB_PATH=%APP_HOME%\lib
|
||||
set APP_CONF_PATH=%APP_HOME%\conf
|
||||
|
||||
::java虚拟机启动参数
|
||||
set JAVA_OPTS=-server -Xms1024m -Xmx1024m -Xmn512m -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Doracle.jdbc.J2EE13Compliant=true
|
||||
set JAVA_OPTS=-server -Xms4096m -Xmx4096m -Xmn2048m -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Doracle.jdbc.J2EE13Compliant=true
|
||||
|
||||
::打印环境信息
|
||||
echo System Information:
|
||||
|
@@ -21,7 +21,7 @@ APP_LIB_PATH=$APP_HOME/lib
|
||||
APP_CONF_PATH=$APP_HOME/conf
|
||||
|
||||
# JVMFLAGS JVM参数可以在这里设置
|
||||
JVMFLAGS="-Xms2g -Xmx2g -Xmn1g -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dfile.encoding=UTF-8 -Doracle.jdbc.J2EE13Compliant=true"
|
||||
JVMFLAGS="-Xms4g -Xmx4g -Xmn2g -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dfile.encoding=UTF-8 -Doracle.jdbc.J2EE13Compliant=true"
|
||||
|
||||
if [ "$JAVA_HOME" != "" ]; then
|
||||
JAVA="$JAVA_HOME/bin/java"
|
||||
|
@@ -21,7 +21,7 @@ set APP_LIB_PATH=%APP_HOME%\lib
|
||||
set APP_CONF_PATH=%APP_HOME%\conf
|
||||
|
||||
::java虚拟机启动参数
|
||||
set JAVA_OPTS=-server -Xms4096m -Xmx4096m -Xmn1024m -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Doracle.jdbc.J2EE13Compliant=true
|
||||
set JAVA_OPTS=-server -Xms4096m -Xmx4096m -Xmn2048m -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Doracle.jdbc.J2EE13Compliant=true
|
||||
|
||||
::打印环境信息
|
||||
echo System Information:
|
||||
|
@@ -30,7 +30,7 @@ echo -n `date +'%Y-%m-%d %H:%M:%S'` >>${APP_RUN_LOG}
|
||||
echo "---- Start service [${APP_MAIN}] process. ">>${APP_RUN_LOG}
|
||||
|
||||
# JVMFLAGS JVM参数可以在这里设置
|
||||
JVMFLAGS="-Dfile.encoding=UTF-8 -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:./gc.log"
|
||||
JVMFLAGS="-Dfile.encoding=UTF-8 -server -Xms4096m -Xmx4096m -Xmn2048m -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:./gc.log"
|
||||
|
||||
if [ "$JAVA_HOME" != "" ]; then
|
||||
JAVA="$JAVA_HOME/bin/java"
|
||||
|
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gitee.dbswitch</groupId>
|
||||
<artifactId>dbswitch-parent</artifactId>
|
||||
<version>1.6.9</version>
|
||||
<version>1.6.10</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>dbswitch</name>
|
||||
<description>database switch project</description>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
set APP_VERSION=1.6.9
|
||||
set APP_VERSION=1.6.10
|
||||
|
||||
echo "Clean Project ..."
|
||||
call mvn clean -f pom.xml
|
||||
|
Reference in New Issue
Block a user