DDL生成器会自动为timestamp类型添加DEFAULT CURRENT_TIMESTAMP, 显式指定会导致重复DEFAULT声明,MySQL报错1067。 修复的表: - discount_marketing (created_at, updated_at) - discount_promo_code (created_at) - discount_customer_bind (created_at)
98 lines
2.3 KiB
JSON
98 lines
2.3 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "discount_customer_bind",
|
|
"title": "客户归属关系",
|
|
"primary": ["id"],
|
|
"catelog": "relation"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "customerid",
|
|
"title": "客户用户id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "resellerid",
|
|
"title": "归属商户机构id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "sale_id",
|
|
"title": "归属销售用户id",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "promo_code_id",
|
|
"title": "促销码id(可空=手动分配)",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "bind_type",
|
|
"title": "绑定方式(1=促销码 2=手动分配)",
|
|
"type": "char",
|
|
"length": 1,
|
|
"default": "1",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "绑定时间",
|
|
"type": "timestamp",
|
|
"nullable": "no"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_dcb_customer",
|
|
"idxtype": "unique",
|
|
"idxfields": ["customerid"]
|
|
},
|
|
{
|
|
"name": "idx_dcb_reseller",
|
|
"idxtype": "index",
|
|
"idxfields": ["resellerid"]
|
|
},
|
|
{
|
|
"name": "idx_dcb_sale",
|
|
"idxtype": "index",
|
|
"idxfields": ["sale_id"]
|
|
},
|
|
{
|
|
"name": "idx_dcb_promo",
|
|
"idxtype": "index",
|
|
"idxfields": ["promo_code_id"]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "resellerid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "bind_type",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='bind_type'"
|
|
}
|
|
]
|
|
}
|