代码拉取完成,页面将自动刷新
同步操作将从 CPC123456/koa2-typescript 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
{
"modules": [
{
"name": "谷歌插件模块",
"chnname": "谷歌插件模块",
"entities": [
{
"title": "shop",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "name",
"type": "TEXT",
"remark": "",
"chnname": "店铺名称"
},
{
"name": "phone",
"type": "TEXT",
"remark": "",
"chnname": "手机号"
},
{
"name": "email",
"type": "TEXT",
"remark": "",
"chnname": "邮箱"
},
{
"name": "description",
"type": "TEXT",
"remark": "",
"chnname": "描述"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "店铺信息表"
},
{
"title": "chromePlugin",
"fields": [
{
"name": "REVISION",
"type": "Integer",
"remark": "",
"chnname": "乐观锁"
},
{
"name": "CREATED_BY",
"type": "IdOrKey",
"remark": "",
"chnname": "创建人"
},
{
"name": "CREATED_TIME",
"type": "DateTime",
"remark": "",
"chnname": "创建时间"
},
{
"name": "UPDATED_BY",
"type": "IdOrKey",
"remark": "",
"chnname": "更新人"
},
{
"name": "UPDATED_TIME",
"type": "DateTime",
"remark": "",
"chnname": "更新时间"
}
]
},
{
"title": "goods",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "name",
"type": "TEXT",
"remark": "",
"chnname": "商品名称"
},
{
"name": "shopId",
"type": "TEXT",
"remark": "",
"chnname": "店铺id"
},
{
"name": "description",
"type": "TEXT",
"remark": "",
"chnname": "描述"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "商品信息表"
},
{
"title": "order",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "订单编号",
"pk": true,
"notNull": true
},
{
"name": "goodsId",
"type": "TEXT",
"remark": "",
"chnname": "商品id"
},
{
"name": "num",
"type": "TEXT",
"remark": "",
"chnname": "订单数量"
},
{
"name": "totalPrice",
"type": "TEXT",
"remark": "",
"chnname": "商品总价"
},
{
"name": "realMoney",
"type": "TEXT",
"remark": "",
"chnname": "实收金额"
},
{
"name": "dealTime",
"type": "TEXT",
"remark": "",
"chnname": "成交时间"
},
{
"name": "description",
"type": "TEXT",
"remark": "",
"chnname": "描述"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "订单信息表"
},
{
"title": "promotionUnit",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "shopId",
"type": "TEXT",
"remark": "",
"chnname": "店铺id"
},
{
"name": "planeId",
"type": "TEXT",
"remark": "",
"chnname": "计划id"
},
{
"name": "goodsId",
"type": "TEXT",
"remark": "",
"chnname": "商品id"
},
{
"name": "spend",
"type": "INTEGER",
"remark": "",
"chnname": "花费"
},
{
"name": "sum",
"type": "INTEGER",
"remark": "",
"chnname": "交易额"
},
{
"name": "inOutRatio",
"type": "INTEGER",
"remark": "",
"chnname": "投入产出比"
},
{
"name": "dealNum",
"type": "INTEGER",
"remark": "",
"chnname": "成交笔数"
},
{
"name": "oneCost",
"type": "INTEGER",
"remark": "",
"chnname": "每笔成交花费"
},
{
"name": "oneTurnover",
"type": "INTEGER",
"remark": "",
"chnname": "每笔成交金额"
},
{
"name": "exposureNum",
"type": "INTEGER",
"remark": "",
"chnname": "曝光量"
},
{
"name": "clickNum",
"type": "INTEGER",
"remark": "",
"chnname": "点击量"
},
{
"name": "clickConvRate",
"type": "INTEGER",
"remark": "",
"chnname": "点击转化率"
},
{
"name": "oneClickCost",
"type": "INTEGER",
"remark": "",
"chnname": "平均点击花费"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "推广单元表"
},
{
"title": "promotionPlane",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "name",
"type": "TEXT",
"remark": "",
"chnname": "计划名"
},
{
"name": "shopId",
"type": "TEXT",
"remark": "",
"chnname": "店铺id"
},
{
"name": "price",
"type": "INTEGER",
"remark": "",
"chnname": "当前价格"
},
{
"name": "factor",
"type": "INTEGER",
"remark": "",
"chnname": "浮动值"
},
{
"name": "limitUpper",
"type": "INTEGER",
"remark": "",
"chnname": "价格上限"
},
{
"name": "limitLower",
"type": "INTEGER",
"remark": "",
"chnname": "价格下限"
},
{
"name": "priority",
"type": "INTEGER",
"remark": "",
"chnname": "优先级"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "推广计划表"
},
{
"title": "goodsPlane",
"fields": [
{
"name": "goodsId",
"type": "TEXT",
"remark": "",
"chnname": "商品id"
},
{
"name": "planeId",
"type": "TEXT",
"remark": "",
"chnname": "计划id"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "商品计划关联表"
}
],
"graphCanvas": {
"nodes": [
{
"shape": "table",
"title": "shop",
"moduleName": false,
"x": 190,
"y": 190,
"id": "859a95c3"
},
{
"shape": "table",
"title": "promotionUnit",
"moduleName": false,
"x": 1220,
"y": 270,
"id": "19a97042"
},
{
"shape": "table",
"title": "order",
"moduleName": false,
"x": 1180,
"y": 600,
"id": "54af0ea2",
"size": [
258.7050687896601,
165.24613895444793
]
},
{
"shape": "table",
"title": "goods",
"moduleName": false,
"x": 640,
"y": 640,
"id": "2fc473cf",
"size": [
179.9284573706168,
125.01970192460959
]
},
{
"shape": "table",
"title": "promotionPlane",
"moduleName": false,
"x": 710,
"y": 310,
"id": "85288b9e"
},
{
"shape": "table",
"title": "goodsPlane",
"moduleName": false,
"x": 240,
"y": 470,
"id": "a5dabea0"
}
],
"edges": [
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "859a95c3",
"target": "2fc473cf",
"id": "1aab3b3b",
"controlPoints": [
{
"x": 335.5576171875,
"y": 152.25
},
{
"x": 494.4423828125,
"y": 652.5895314387298
}
],
"sourceAnchor": 1,
"targetAnchor": 4
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "2fc473cf",
"target": "54af0ea2",
"id": "9bc80935",
"controlPoints": [
{
"x": 785.5576171875,
"y": 607.4607135463455
},
{
"x": 1024.14746560517,
"y": 564.731629745375
}
],
"sourceAnchor": 1,
"targetAnchor": 2
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "859a95c3",
"target": "19a97042",
"id": "c74241f9",
"controlPoints": [
{
"x": 335.5576171875,
"y": 152.25
},
{
"x": 1064.8916015625,
"y": 162.17424242424244
}
],
"sourceAnchor": 1,
"targetAnchor": 2
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "85288b9e",
"target": "19a97042",
"id": "dd50056d",
"controlPoints": [
{
"x": 855.5576171875,
"y": 242.17857142857144
},
{
"x": 1064.8916015625,
"y": 182.2348484848485
}
],
"sourceAnchor": 1,
"targetAnchor": 4
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "2fc473cf",
"target": "19a97042",
"id": "37fe073e",
"controlPoints": [
{
"x": 785.5576171875,
"y": 607.4607135463455
},
{
"x": 1064.8916015625,
"y": 202.29545454545456
}
],
"sourceAnchor": 1,
"targetAnchor": 6
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "2fc473cf",
"target": "a5dabea0",
"id": "38a732e0",
"controlPoints": [
{
"x": 494.4423828125,
"y": 607.4607135463455
},
{
"x": 332.0283203125,
"y": 472.5357142857143
}
],
"sourceAnchor": 0,
"targetAnchor": 1
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "859a95c3",
"target": "85288b9e",
"id": "9791a3ce",
"controlPoints": [
{
"x": 335.5576171875,
"y": 152.25
},
{
"x": 564.4423828125,
"y": 282.3690476190476
}
],
"sourceAnchor": 1,
"targetAnchor": 4
}
]
},
"associations": [
{
"relation": "0,n:1",
"from": {
"entity": "shop",
"field": "id"
},
"to": {
"entity": "goods",
"field": "shopId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "goods",
"field": "id"
},
"to": {
"entity": "order",
"field": "goodsId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "shop",
"field": "id"
},
"to": {
"entity": "promotionUnit",
"field": "shopId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "promotionPlane",
"field": "id"
},
"to": {
"entity": "promotionUnit",
"field": "planeId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "goods",
"field": "id"
},
"to": {
"entity": "promotionUnit",
"field": "goodsId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "goods",
"field": "id"
},
"to": {
"entity": "goodsPlane",
"field": "goodsId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "shop",
"field": "id"
},
"to": {
"entity": "promotionPlane",
"field": "shopId"
}
}
]
},
{
"name": "接口爬取模块",
"chnname": "接口爬取模块",
"entities": [],
"graphCanvas": {
"edges": []
}
}
],
"dataTypeDomains": {
"datatype": [
{
"name": "默认字串",
"code": "DefaultString",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(32)"
},
"ORACLE": {
"type": "NVARCHAR2(32)"
},
"SQLServer": {
"type": "NVARCHAR(32)"
},
"PostgreSQL": {
"type": "VARCHAR(32)"
}
}
},
{
"name": "标识号",
"code": "IdOrKey",
"apply": {
"JAVA": {
"type": "String"
},
"ORACLE": {
"type": "VARCHAR2(32)"
},
"MYSQL": {
"type": "VARCHAR(32)"
},
"SQLServer": {
"type": "VARCHAR(32)"
},
"PostgreSQL": {
"type": "VARCHAR(32)"
}
}
},
{
"name": "标识号-长",
"code": "LongKey",
"apply": {
"MYSQL": {
"type": "VARCHAR(64)"
},
"ORACLE": {
"type": "VARCHAR2(64)"
},
"JAVA": {
"type": "String"
},
"SQLServer": {
"type": "VARCHAR(64)"
},
"PostgreSQL": {
"type": "VARCHAR(64)"
}
}
},
{
"name": "名称",
"code": "Name",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(128)"
},
"ORACLE": {
"type": "NVARCHAR2(128)"
},
"SQLServer": {
"type": "NVARCHAR(128)"
},
"PostgreSQL": {
"type": "VARCHAR(128)"
}
}
},
{
"name": "备注说明",
"code": "Intro",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(512)"
},
"ORACLE": {
"type": "NVARCHAR2(512)"
},
"SQLServer": {
"type": "NVARCHAR(512)"
},
"PostgreSQL": {
"type": "VARCHAR(512)"
}
}
},
{
"name": "字串-短",
"code": "ShortString",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(128)"
},
"ORACLE": {
"type": "NVARCHAR2(128)"
},
"SQLServer": {
"type": "NVARCHAR(128)"
},
"PostgreSQL": {
"type": "VARCHAR(128)"
}
}
},
{
"name": "字串-中",
"code": "MiddleString",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(1024)"
},
"ORACLE": {
"type": "NVARCHAR2(1024)"
},
"SQLServer": {
"type": "NVARCHAR(1024)"
},
"PostgreSQL": {
"type": "VARCHAR(1024)"
}
}
},
{
"name": "字串-长",
"code": "LongString",
"apply": {
"JAVA": {
"type": "String"
},
"ORACLE": {
"type": "NVARCHAR2(3072)"
},
"MYSQL": {
"type": "VARCHAR(3072)"
},
"SQLServer": {
"type": "NVARCHAR(3072)"
},
"PostgreSQL": {
"type": "VARCHAR(3072)"
}
}
},
{
"name": "大文本",
"code": "LongText",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "TEXT"
},
"ORACLE": {
"type": "CLOB"
},
"SQLServer": {
"type": "NTEXT"
},
"PostgreSQL": {
"type": "TEXT"
}
}
},
{
"name": "小数",
"code": "Double",
"apply": {
"JAVA": {
"type": "Double"
},
"MYSQL": {
"type": "DECIMAL(32,10)"
},
"ORACLE": {
"type": "NUMBER(32,10)"
},
"SQLServer": {
"type": "DECIMAL(32,10)"
},
"PostgreSQL": {
"type": "DECIMAL(32,10)"
}
}
},
{
"name": "比例",
"code": "Ratio",
"apply": {
"MYSQL": {
"type": "DECIMAL(4,2)"
},
"JAVA": {
"type": "Double"
},
"ORACLE": {
"type": "NUMBER(4,2)"
},
"SQLServer": {
"type": "DECIMAL(4,2)"
},
"PostgreSQL": {
"type": "DECIMAL(4,2)"
}
}
},
{
"name": "整数",
"code": "Integer",
"apply": {
"JAVA": {
"type": "Integer"
},
"MYSQL": {
"type": "INT"
},
"ORACLE": {
"type": "INT"
},
"SQLServer": {
"type": "INT"
},
"PostgreSQL": {
"type": "INT"
}
}
},
{
"name": "大整数",
"code": "BigInt",
"apply": {
"MYSQL": {
"type": "BIGINT"
},
"JAVA": {
"type": "Long"
},
"ORACLE": {
"type": "NUMBER"
},
"SQLServer": {
"type": "BIGINT"
},
"PostgreSQL": {
"type": "BIGINT"
}
}
},
{
"name": "金额",
"code": "Money",
"apply": {
"JAVA": {
"type": "Double"
},
"MYSQL": {
"type": "DECIMAL(32,8)"
},
"ORACLE": {
"type": "NUMBER(32,8)"
},
"SQLServer": {
"type": "DECIMAL(32,8)"
},
"PostgreSQL": {
"type": "DECIMAL(32,8)"
}
}
},
{
"name": "是否",
"code": "YesNo",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(1)"
},
"ORACLE": {
"type": "VARCHAR2(1)"
},
"SQLServer": {
"type": "VARCHAR(1)"
},
"PostgreSQL": {
"type": "VARCHAR(1)"
}
}
},
{
"name": "数据字典",
"code": "Dict",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(32)"
},
"ORACLE": {
"type": "VARCHAR2(32)"
},
"SQLServer": {
"type": "VARCHAR(32)"
},
"PostgreSQL": {
"type": "VARCHAR(32)"
}
}
},
{
"name": "日期",
"code": "Date",
"apply": {
"JAVA": {
"type": "Date"
},
"MYSQL": {
"type": "DATE"
},
"ORACLE": {
"type": "DATE"
},
"SQLServer": {
"type": "DATE"
},
"PostgreSQL": {
"type": "DATE"
}
}
},
{
"name": "日期时间",
"code": "DateTime",
"apply": {
"JAVA": {
"type": "Date"
},
"MYSQL": {
"type": "DATETIME"
},
"ORACLE": {
"type": "DATE"
},
"SQLServer": {
"type": "DATE"
},
"PostgreSQL": {
"type": "DATE"
}
}
},
{
"name": "单字符",
"code": "Char",
"apply": {
"MYSQL": {
"type": "CHAR(1)"
},
"ORACLE": {
"type": "CHAR(1)"
},
"JAVA": {
"type": "String"
},
"SQLServer": {
"type": "CHAR(1)"
},
"PostgreSQL": {
"type": "CHAR(1)"
}
}
},
{
"name": "sqlite文本",
"code": "TEXT",
"apply": {
"sqlite3": {
"type": "TEXT"
}
}
},
{
"name": "sqlite数字",
"code": "INTEGER",
"apply": {
"sqlite3": {
"type": "INTEGER"
}
}
},
{
"name": "最后更新时间",
"code": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"apply": {
"sqlite3": {
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP"
}
}
}
],
"database": [
{
"code": "MYSQL",
"template": "DROP TABLE {{=it.entity.title}};\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.entity.chnname,it.entity.remark,';') }}'",
"fileShow": true,
"defaultDatabase": true,
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} {{= field.autoIncrement ? 'AUTO_INCREMENT' : '' }} {{= field.defaultValue ? it.func.join('DEFAULT',field.defaultValue,' ') : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,' ')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.entity.chnname,it.entity.remark,' ') }}'{{=it.separator}}\n$blankline\n",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}",
"rebuildTableTemplate": "create table PDMAN_UP_{{=it.oldEntity.title}}\nas select * from {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}\n{{~it.newEntity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.newEntity.chnname,it.newEntity.remark,';') }}'{{=it.separator}}\n$blankline\n\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\ninsert into {{=it.newEntity.title}}(\n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\n) \nselect \n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\nfrom PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n{{~it.newEntity.indexs:index}}\nALTER TABLE {{=it.newEntity.title}} ADD {{? index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=index.name}}({{=it.func.join(...index.fields,',')}}){{=it.separator}}\n{{~}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.pk}}PRIMARY KEY{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}} {{? it.field.addAfter}}AFTER {{=it.field.addAfter}}{{?}}{{=it.separator}}",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}}{{=it.separator}}",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP {{=it.field.name}}{{=it.separator}}",
"deleteIndexTemplate": "ALTER TABLE {{=it.entity.title}} DROP INDEX {{=it.index.name}}{{=it.separator}}",
"createIndexTemplate": "ALTER TABLE {{=it.entity.title}} ADD {{? it.index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=it.index.name}}({{=it.func.join(...it.index.fields,',')}}){{=it.separator}}",
"updateTableComment": "ALTER TABLE {{=it.entity.title}} COMMENT '{{=it.entity.chnname}}'{{=it.separator}}"
},
{
"code": "ORACLE",
"template": "DROP TABLE {{=it.entity.title}}{{=it.separator}}\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n){{=it.separator}}\n$blankline\nCOMMENT ON TABLE {{=it.entity.title}} IS '{{=it.func.join(it.entity.chnname,it.entity.remark,';') }}'{{=it.separator}}\n{{~it.entity.fields:field:index}}\nCOMMENT ON COLUMN {{=it.entity.title}}.{{=field.name}} IS '{{=it.func.join(field.chnname,field.remark,';')}}'{{=it.separator}}\n{{~}}",
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}}{{? field.defaultValue}} DEFAULT {{=field.defaultValue}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n){{=it.separator}}\n$blankline\n{{? it.entity.chnname || it.entity.remark}}COMMENT ON TABLE {{=it.entity.title}} IS {{? it.entity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.entity.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~it.entity.fields:field:index}}\n{{? field.chnname || field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=field.name}} IS {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~}}",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}\r\n$blankline",
"rebuildTableTemplate": "CREATE TABLE PDMAN_UP_{{=it.oldEntity.title}}\nAS SELECT * FROM {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\nDROP TABLE {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}{{~it.newEntity.fields:field:index}}{{? field.pk }}{{ pkList.push(field.name) }}{{?}} {{=field.name}} {{=field.type}}{{? field.defaultValue}} DEFAULT {{=field.defaultValue}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}{{? pkList.length >0 }} PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}}){{?}}\n){{=it.separator}}\n$blankline\n{{? it.newEntity.chnname || it.newEntity.remark}}COMMENT ON TABLE {{=it.newEntity.title}} IS {{? it.newEntity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.newEntity.chnname}}'{{?}};{{?}}{{=it.separator}}\n{{~it.newEntity.fields:field:index}}\n{{? field.chnname || field.remark}}COMMENT ON COLUMN {{=it.newEntity.title}}.{{=field.name}} IS {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}};{{?}}{{=it.separator}}\n{{~}}\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\n$blankline\nINSERT INTO {{=it.newEntity.title}}(\n{{~sameCols:field:index}} {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}) \nSELECT\n{{~sameCols:field:index}} {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}FROM PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n\nDROP TABLE PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n{{~it.newEntity.indexs:index}}\nCREATE{{? index.isUnique}} UNIQUE{{?}} INDEX {{=index.name}} ON {{=it.newEntity.title}}({{=it.func.join(index.fields,',')}}){{=it.separator}}\n{{~}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD({{=it.field.name}} {{=it.field.type}}{{? it.field.defaultValue}} DEFAULT {{=it.field.defaultValue}}{{?}}{{? it.field.notNull}} NOT NULL{{?}}){{=it.separator}}\r\n{{? it.field.chnname || it.field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=it.field.name}} IS {{? it.field.remark}}'{{=it.field.remark}}'{{??}}'{{=it.field.chnname}}'{{?}}{{=it.separator}}{{?}}\r\n$blankline",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY({{=it.field.name}} {{=it.field.type}}{{? it.field.defaultValue}} DEFAULT {{=it.field.defaultValue}}{{?}}{{? it.field.notNull}} NOT NULL{{?}}){{=it.separator}}\r\n{{? it.field.chnname || it.field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=it.field.name}} IS {{? it.field.remark}}'{{=it.field.remark}}'{{??}}'{{=it.field.chnname}}'{{?}}{{=it.separator}}{{=it.separator}}{{?}}\r\n$blankline",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP({{=it.field.name}}){{=it.separator}}\r\n$blankline",
"deleteIndexTemplate": "DROP INDEX {{=it.entity.title}}.{{=it.index.name}}{{=it.separator}}\r\n$blankline",
"createIndexTemplate": "CREATE{{? it.index.isUnique}} UNIQUE{{?}} INDEX {{=it.index.name}} ON {{=it.entity.title}}({{=it.func.join(it.index.fields,',')}}){{=it.separator}}\r\n$blankline",
"updateTableComment": "{{? it.entity.chnname || it.entity.remark}}COMMENT ON TABLE {{=it.entity.title}} IS {{? it.entity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.entity.chnname}}'{{?}}{{=it.separator}}{{?}}\r\n$blankline"
},
{
"code": "SQLServer",
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} {{= field.autoIncrement ? 'IDENTITY(1,1)' : '' }} {{= field.defaultValue ? it.func.join('DEFAULT',field.defaultValue,' ') : '' }} {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n CONSTRAINT PK_{{=it.entity.title}} PRIMARY KEY CLUSTERED ({{~pkList:pkName:i}}{{= pkName }} ASC {{= i<pkList.length-1 ? ',' : '' }}{{~}}) ON [PRIMARY] \n{{?}}\n){{=it.separator}}\n\n$blankline\nEXECUTE sp_addextendedproperty N'MS_Description', '{{= it.entity.chnname || it.entity.remark}}', N'user', N'dbo', N'table', N'{{=it.entity.title}}', NULL, NULL{{=it.separator}}\n{{~it.entity.fields:field:index}}\n{{? field.chnname || field.remark}}EXECUTE sp_addextendedproperty N'MS_Description', {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}}, N'user', N'dbo', N'table', N'{{=it.entity.title}}', N'column', N'{{=field.name}}'{{=it.separator}}{{?}}\n{{~}}\n",
"deleteTableTemplate": "",
"rebuildTableTemplate": "",
"createFieldTemplate": "",
"updateFieldTemplate": "",
"deleteFieldTemplate": "",
"deleteIndexTemplate": "",
"createIndexTemplate": "",
"updateTableComment": ""
},
{
"code": "PostgreSQL",
"template": "DROP TABLE {{=it.entity.title}};\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.entity.chnname,it.entity.remark,';') }}'",
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}}{{? field.defaultValue}} DEFAULT {{=field.defaultValue}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n){{=it.separator}}\n$blankline\n{{? it.entity.chnname || it.entity.remark}}COMMENT ON TABLE {{=it.entity.title}} IS {{? it.entity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.entity.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~it.entity.fields:field:index}}\n{{? field.chnname || field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=field.name}} IS {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~}}",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}",
"rebuildTableTemplate": "create table PDMAN_UP_{{=it.oldEntity.title}}\nas select * from {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}\n{{~it.newEntity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.newEntity.chnname,it.newEntity.remark,';') }}'{{=it.separator}}\n$blankline\n\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\ninsert into {{=it.newEntity.title}}(\n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\n) \nselect \n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\nfrom PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.pk}}PRIMARY KEY{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}} {{? it.field.addAfter}}AFTER {{=it.field.addAfter}}{{?}}{{=it.separator}}",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}}{{=it.separator}}",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP {{=it.field.name}}{{=it.separator}}",
"deleteIndexTemplate": "ALTER TABLE {{=it.entity.title}} DROP INDEX {{=it.index.name}}{{=it.separator}}",
"createIndexTemplate": "ALTER TABLE {{=it.entity.title}} ADD {{? it.index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=it.index.name}}({{=it.func.join(...it.index.fields,',')}}){{=it.separator}}",
"updateTableComment": "ALTER TABLE {{=it.entity.title}} COMMENT '{{=it.entity.chnname}}'{{=it.separator}}"
},
{
"code": "JAVA",
"template": "package group.rober.pdman.{{=it.module.name}}.entity;\n$blankline\nimport javax.persistence.*;\nimport java.io.Serializable;\nimport java.util.Date;\n$blankline\n$blankline\n\n/** {{=it.entity.chnname}} */\n@Table(name=\"{{=it.entity.title}}\")\npublic class {{=it.func.camel(it.entity.title,true) }} implements Serializable,Cloneable{\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n {{? field.pk }}\n @Id\n @GeneratedValue\n {{?}}\n private {{=field.type}} {{=it.func.camel(field.name,false)}} ;\n{{~}}\n$blankline\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public {{=field.type}} get{{=it.func.camel(field.name,true)}}(){\n return this.{{=it.func.camel(field.name,false)}};\n }\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public void set{{=it.func.camel(field.name,true)}}({{=field.type}} {{= it.func.camel(field.name,false) }}){\n this.{{=it.func.camel(field.name,false)}} = {{= it.func.camel(field.name,false) }};\n }\n{{~}}\n}",
"createTableTemplate": "package group.rober.pdman.{{=it.module.name}}.entity;\n$blankline\nimport javax.persistence.*;\nimport java.io.Serializable;\nimport java.util.Date;\n$blankline\n$blankline\n@Table(name=\"{{=it.entity.title}}\")\npublic class {{=it.func.camel(it.entity.title,true) }} implements Serializable,Cloneable{\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n {{? field.pk }}\n @Id\n @GeneratedValue\n {{?}}\n private {{=field.type}} {{=it.func.camel(field.name,false)}} ;\n{{~}}\n$blankline\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public {{=field.type}} get{{=it.func.camel(field.name,true)}}(){\n return this.{{=it.func.camel(field.name,false)}};\n }\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public void set{{=it.func.camel(field.name,true)}}({{=field.type}} {{= it.func.camel(field.name,false) }}){\n this.{{=it.func.camel(field.name,false)}} = {{= it.func.camel(field.name,false) }};\n }\n{{~}}\n}",
"deleteTableTemplate": "",
"rebuildTableTemplate": "",
"createFieldTemplate": "",
"updateFieldTemplate": "",
"deleteFieldTemplate": "",
"deleteIndexTemplate": "",
"createIndexTemplate": "",
"updateTableComment": ""
},
{
"code": "sqlite3",
"createTableTemplate": "{{~it.entity.fields:field:index}}\n \"{{=field.name}}\": \"{{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }}\",//{{=it.func.join(field.chnname,field.remark,' ')}}\n{{~}}",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}",
"rebuildTableTemplate": "create table PDMAN_UP_{{=it.oldEntity.title}}\nas select * from {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}\n{{~it.newEntity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.newEntity.chnname,it.newEntity.remark,';') }}'{{=it.separator}}\n$blankline\n\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\ninsert into {{=it.newEntity.title}}(\n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\n) \nselect \n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\nfrom PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n{{~it.newEntity.indexs:index}}\nALTER TABLE {{=it.newEntity.title}} ADD {{? index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=index.name}}({{=it.func.join(...index.fields,',')}}){{=it.separator}}\n{{~}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.pk}}PRIMARY KEY{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}} {{? it.field.addAfter}}AFTER {{=it.field.addAfter}}{{?}}{{=it.separator}}",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}}{{=it.separator}}",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP {{=it.field.name}}{{=it.separator}}",
"deleteIndexTemplate": "ALTER TABLE {{=it.entity.title}} DROP INDEX {{=it.index.name}}{{=it.separator}}",
"createIndexTemplate": "ALTER TABLE {{=it.entity.title}} ADD {{? it.index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=it.index.name}}({{=it.func.join(...it.index.fields,',')}}){{=it.separator}}",
"updateTableComment": "ALTER TABLE {{=it.entity.title}} COMMENT '{{=it.entity.chnname}}'{{=it.separator}}"
}
]
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。