From dc1fa5e7536ed82c5cdf09c104c7ec21ed7b3293 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 27 May 2026 13:23:23 +0800 Subject: [PATCH] refactor(models): convert to json format per database-table-definition-spec --- models/contract.json | 20 ++++++++++++++------ models/contract_ai_config.json | 8 ++++++-- models/contract_attachment.json | 17 +++++++++++++---- models/contract_milestones.json | 16 ++++++++++++---- models/contract_versions.json | 18 ++++++++++++++---- models/order_payments.json | 16 ++++++++++++---- models/orders.json | 24 ++++++++++++++++++------ 7 files changed, 89 insertions(+), 30 deletions(-) diff --git a/models/contract.json b/models/contract.json index 6ac1100..84e00fb 100644 --- a/models/contract.json +++ b/models/contract.json @@ -3,7 +3,9 @@ { "name": "contract", "title": "合同表", - "primary": "id" + "primary": [ + "id" + ] } ], "fields": [ @@ -17,7 +19,7 @@ }, { "name": "contract_number", - "title": "合同编号", + "title": "合同编号", "type": "str", "length": 50, "nullable": "no", @@ -190,17 +192,23 @@ { "name": "idx_contract_number", "idxtype": "unique", - "idxfields": ["contract_number"] + "idxfields": [ + "contract_number" + ] }, { "name": "idx_contract_org", "idxtype": "index", - "idxfields": ["org_id"] + "idxfields": [ + "org_id" + ] }, { "name": "idx_contract_status", - "idxtype": "index", - "idxfields": ["status"] + "idxtype": "index", + "idxfields": [ + "status" + ] } ], "codes": [ diff --git a/models/contract_ai_config.json b/models/contract_ai_config.json index 551034e..044139c 100644 --- a/models/contract_ai_config.json +++ b/models/contract_ai_config.json @@ -3,7 +3,9 @@ { "name": "contract_ai_config", "title": "AI配置表", - "primary": "id" + "primary": [ + "id" + ] } ], "fields": [ @@ -58,7 +60,9 @@ { "name": "idx_ai_config_org", "idxtype": "unique", - "idxfields": ["org_id"] + "idxfields": [ + "org_id" + ] } ] } \ No newline at end of file diff --git a/models/contract_attachment.json b/models/contract_attachment.json index fe04b7e..bd67dca 100644 --- a/models/contract_attachment.json +++ b/models/contract_attachment.json @@ -3,7 +3,9 @@ { "name": "contract_attachment", "title": "合同附件表", - "primary": "id" + "primary": [ + "id" + ] } ], "fields": [ @@ -98,17 +100,24 @@ { "name": "idx_attachment_contract", "idxtype": "index", - "idxfields": ["contract_id"] + "idxfields": [ + "contract_id" + ] }, { "name": "idx_attachment_org", "idxtype": "index", - "idxfields": ["org_id"] + "idxfields": [ + "org_id" + ] }, { "name": "idx_attachment_version", "idxtype": "index", - "idxfields": ["file_name", "version"] + "idxfields": [ + "file_name", + "version" + ] } ], "codes": [ diff --git a/models/contract_milestones.json b/models/contract_milestones.json index c29e810..98cc654 100644 --- a/models/contract_milestones.json +++ b/models/contract_milestones.json @@ -3,7 +3,9 @@ { "name": "contract_milestones", "title": "合同里程碑管理表", - "primary": "id", + "primary": [ + "id" + ], "catelog": "relation" } ], @@ -107,17 +109,23 @@ { "name": "idx_milestones_contract", "idxtype": "index", - "idxfields": ["contract_id"] + "idxfields": [ + "contract_id" + ] }, { "name": "idx_milestones_status", "idxtype": "index", - "idxfields": ["status"] + "idxfields": [ + "status" + ] }, { "name": "idx_milestones_planned", "idxtype": "index", - "idxfields": ["planned_date"] + "idxfields": [ + "planned_date" + ] } ] } \ No newline at end of file diff --git a/models/contract_versions.json b/models/contract_versions.json index f8f0e03..12b51ed 100644 --- a/models/contract_versions.json +++ b/models/contract_versions.json @@ -3,7 +3,9 @@ { "name": "contract_versions", "title": "合同版本管理表", - "primary": "id", + "primary": [ + "id" + ], "catelog": "relation" } ], @@ -82,17 +84,25 @@ { "name": "idx_contract_versions_contract", "idxtype": "index", - "idxfields": ["contract_id"] + "idxfields": [ + "contract_id" + ] }, { "name": "idx_contract_versions_version", "idxtype": "unique", - "idxfields": ["contract_id", "version_number"] + "idxfields": [ + "contract_id", + "version_number" + ] }, { "name": "idx_contract_versions_current", "idxtype": "index", - "idxfields": ["contract_id", "is_current"] + "idxfields": [ + "contract_id", + "is_current" + ] } ] } \ No newline at end of file diff --git a/models/order_payments.json b/models/order_payments.json index 5b84438..90627e7 100644 --- a/models/order_payments.json +++ b/models/order_payments.json @@ -3,7 +3,9 @@ { "name": "order_payments", "title": "订单付款记录表", - "primary": "id", + "primary": [ + "id" + ], "catelog": "relation" } ], @@ -99,17 +101,23 @@ { "name": "idx_payments_order", "idxtype": "index", - "idxfields": ["order_id"] + "idxfields": [ + "order_id" + ] }, { "name": "idx_payments_status", "idxtype": "index", - "idxfields": ["status"] + "idxfields": [ + "status" + ] }, { "name": "idx_payments_date", "idxtype": "index", - "idxfields": ["payment_date"] + "idxfields": [ + "payment_date" + ] } ] } \ No newline at end of file diff --git a/models/orders.json b/models/orders.json index 276a704..1fdfab8 100644 --- a/models/orders.json +++ b/models/orders.json @@ -3,7 +3,9 @@ { "name": "orders", "title": "订单表", - "primary": "id", + "primary": [ + "id" + ], "catelog": "entity" } ], @@ -150,27 +152,37 @@ { "name": "idx_orders_number", "idxtype": "unique", - "idxfields": ["order_number"] + "idxfields": [ + "order_number" + ] }, { "name": "idx_orders_contract", "idxtype": "index", - "idxfields": ["contract_id"] + "idxfields": [ + "contract_id" + ] }, { "name": "idx_orders_customer", "idxtype": "index", - "idxfields": ["customer_id"] + "idxfields": [ + "customer_id" + ] }, { "name": "idx_orders_status", "idxtype": "index", - "idxfields": ["status"] + "idxfields": [ + "status" + ] }, { "name": "idx_orders_owner", "idxtype": "index", - "idxfields": ["owner_id"] + "idxfields": [ + "owner_id" + ] } ] } \ No newline at end of file