refactor(models): convert to json format per database-table-definition-spec

This commit is contained in:
yumoqing 2026-05-27 13:23:23 +08:00
parent 805f7fc94f
commit dc1fa5e753
7 changed files with 89 additions and 30 deletions

View File

@ -3,7 +3,9 @@
{ {
"name": "contract", "name": "contract",
"title": "合同表", "title": "合同表",
"primary": "id" "primary": [
"id"
]
} }
], ],
"fields": [ "fields": [
@ -17,7 +19,7 @@
}, },
{ {
"name": "contract_number", "name": "contract_number",
"title": "合同编号", "title": "合同编号",
"type": "str", "type": "str",
"length": 50, "length": 50,
"nullable": "no", "nullable": "no",
@ -190,17 +192,23 @@
{ {
"name": "idx_contract_number", "name": "idx_contract_number",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["contract_number"] "idxfields": [
"contract_number"
]
}, },
{ {
"name": "idx_contract_org", "name": "idx_contract_org",
"idxtype": "index", "idxtype": "index",
"idxfields": ["org_id"] "idxfields": [
"org_id"
]
}, },
{ {
"name": "idx_contract_status", "name": "idx_contract_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["status"] "idxfields": [
"status"
]
} }
], ],
"codes": [ "codes": [

View File

@ -3,7 +3,9 @@
{ {
"name": "contract_ai_config", "name": "contract_ai_config",
"title": "AI配置表", "title": "AI配置表",
"primary": "id" "primary": [
"id"
]
} }
], ],
"fields": [ "fields": [
@ -58,7 +60,9 @@
{ {
"name": "idx_ai_config_org", "name": "idx_ai_config_org",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["org_id"] "idxfields": [
"org_id"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "contract_attachment", "name": "contract_attachment",
"title": "合同附件表", "title": "合同附件表",
"primary": "id" "primary": [
"id"
]
} }
], ],
"fields": [ "fields": [
@ -98,17 +100,24 @@
{ {
"name": "idx_attachment_contract", "name": "idx_attachment_contract",
"idxtype": "index", "idxtype": "index",
"idxfields": ["contract_id"] "idxfields": [
"contract_id"
]
}, },
{ {
"name": "idx_attachment_org", "name": "idx_attachment_org",
"idxtype": "index", "idxtype": "index",
"idxfields": ["org_id"] "idxfields": [
"org_id"
]
}, },
{ {
"name": "idx_attachment_version", "name": "idx_attachment_version",
"idxtype": "index", "idxtype": "index",
"idxfields": ["file_name", "version"] "idxfields": [
"file_name",
"version"
]
} }
], ],
"codes": [ "codes": [

View File

@ -3,7 +3,9 @@
{ {
"name": "contract_milestones", "name": "contract_milestones",
"title": "合同里程碑管理表", "title": "合同里程碑管理表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -107,17 +109,23 @@
{ {
"name": "idx_milestones_contract", "name": "idx_milestones_contract",
"idxtype": "index", "idxtype": "index",
"idxfields": ["contract_id"] "idxfields": [
"contract_id"
]
}, },
{ {
"name": "idx_milestones_status", "name": "idx_milestones_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["status"] "idxfields": [
"status"
]
}, },
{ {
"name": "idx_milestones_planned", "name": "idx_milestones_planned",
"idxtype": "index", "idxtype": "index",
"idxfields": ["planned_date"] "idxfields": [
"planned_date"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "contract_versions", "name": "contract_versions",
"title": "合同版本管理表", "title": "合同版本管理表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -82,17 +84,25 @@
{ {
"name": "idx_contract_versions_contract", "name": "idx_contract_versions_contract",
"idxtype": "index", "idxtype": "index",
"idxfields": ["contract_id"] "idxfields": [
"contract_id"
]
}, },
{ {
"name": "idx_contract_versions_version", "name": "idx_contract_versions_version",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["contract_id", "version_number"] "idxfields": [
"contract_id",
"version_number"
]
}, },
{ {
"name": "idx_contract_versions_current", "name": "idx_contract_versions_current",
"idxtype": "index", "idxtype": "index",
"idxfields": ["contract_id", "is_current"] "idxfields": [
"contract_id",
"is_current"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "order_payments", "name": "order_payments",
"title": "订单付款记录表", "title": "订单付款记录表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -99,17 +101,23 @@
{ {
"name": "idx_payments_order", "name": "idx_payments_order",
"idxtype": "index", "idxtype": "index",
"idxfields": ["order_id"] "idxfields": [
"order_id"
]
}, },
{ {
"name": "idx_payments_status", "name": "idx_payments_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["status"] "idxfields": [
"status"
]
}, },
{ {
"name": "idx_payments_date", "name": "idx_payments_date",
"idxtype": "index", "idxtype": "index",
"idxfields": ["payment_date"] "idxfields": [
"payment_date"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "orders", "name": "orders",
"title": "订单表", "title": "订单表",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
], ],
@ -150,27 +152,37 @@
{ {
"name": "idx_orders_number", "name": "idx_orders_number",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["order_number"] "idxfields": [
"order_number"
]
}, },
{ {
"name": "idx_orders_contract", "name": "idx_orders_contract",
"idxtype": "index", "idxtype": "index",
"idxfields": ["contract_id"] "idxfields": [
"contract_id"
]
}, },
{ {
"name": "idx_orders_customer", "name": "idx_orders_customer",
"idxtype": "index", "idxtype": "index",
"idxfields": ["customer_id"] "idxfields": [
"customer_id"
]
}, },
{ {
"name": "idx_orders_status", "name": "idx_orders_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["status"] "idxfields": [
"status"
]
}, },
{ {
"name": "idx_orders_owner", "name": "idx_orders_owner",
"idxtype": "index", "idxtype": "index",
"idxfields": ["owner_id"] "idxfields": [
"owner_id"
]
} }
] ]
} }