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

This commit is contained in:
yumoqing 2026-05-27 13:23:25 +08:00
parent 3bb53fcaf7
commit 314b4763ae
4 changed files with 72 additions and 24 deletions

View File

@ -3,7 +3,9 @@
{ {
"name": "customer_handover", "name": "customer_handover",
"title": "客户交接表", "title": "客户交接表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -119,27 +121,37 @@
{ {
"name": "idx_handover_customer", "name": "idx_handover_customer",
"idxtype": "index", "idxtype": "index",
"idxfields": ["customer_id"] "idxfields": [
"customer_id"
]
}, },
{ {
"name": "idx_handover_from_owner", "name": "idx_handover_from_owner",
"idxtype": "index", "idxtype": "index",
"idxfields": ["from_owner_id"] "idxfields": [
"from_owner_id"
]
}, },
{ {
"name": "idx_handover_to_owner", "name": "idx_handover_to_owner",
"idxtype": "index", "idxtype": "index",
"idxfields": ["to_owner_id"] "idxfields": [
"to_owner_id"
]
}, },
{ {
"name": "idx_handover_stage", "name": "idx_handover_stage",
"idxtype": "index", "idxtype": "index",
"idxfields": ["current_stage"] "idxfields": [
"current_stage"
]
}, },
{ {
"name": "idx_handover_created", "name": "idx_handover_created",
"idxtype": "index", "idxtype": "index",
"idxfields": ["created_at"] "idxfields": [
"created_at"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "customer_handover_items", "name": "customer_handover_items",
"title": "客户交接项目明细表", "title": "客户交接项目明细表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -75,17 +77,23 @@
{ {
"name": "idx_handover_items_handover", "name": "idx_handover_items_handover",
"idxtype": "index", "idxtype": "index",
"idxfields": ["handover_id"] "idxfields": [
"handover_id"
]
}, },
{ {
"name": "idx_handover_items_type", "name": "idx_handover_items_type",
"idxtype": "index", "idxtype": "index",
"idxfields": ["item_type"] "idxfields": [
"item_type"
]
}, },
{ {
"name": "idx_handover_items_item_id", "name": "idx_handover_items_item_id",
"idxtype": "index", "idxtype": "index",
"idxfields": ["item_id"] "idxfields": [
"item_id"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "customer_pool", "name": "customer_pool",
"title": "客户公海池表", "title": "客户公海池表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -90,27 +92,37 @@
{ {
"name": "idx_pool_customer", "name": "idx_pool_customer",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["customer_id"] "idxfields": [
"customer_id"
]
}, },
{ {
"name": "idx_pool_original_owner", "name": "idx_pool_original_owner",
"idxtype": "index", "idxtype": "index",
"idxfields": ["original_owner_id"] "idxfields": [
"original_owner_id"
]
}, },
{ {
"name": "idx_pool_assigned_to", "name": "idx_pool_assigned_to",
"idxtype": "index", "idxtype": "index",
"idxfields": ["assigned_to"] "idxfields": [
"assigned_to"
]
}, },
{ {
"name": "idx_pool_status", "name": "idx_pool_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["pool_status"] "idxfields": [
"pool_status"
]
}, },
{ {
"name": "idx_pool_recycled", "name": "idx_pool_recycled",
"idxtype": "index", "idxtype": "index",
"idxfields": ["recycled_at"] "idxfields": [
"recycled_at"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "customers", "name": "customers",
"title": "客户档案表", "title": "客户档案表",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
], ],
@ -131,37 +133,51 @@
{ {
"name": "idx_customers_phone", "name": "idx_customers_phone",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["phone"] "idxfields": [
"phone"
]
}, },
{ {
"name": "idx_customers_tax_id", "name": "idx_customers_tax_id",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["tax_id"] "idxfields": [
"tax_id"
]
}, },
{ {
"name": "idx_customers_owner", "name": "idx_customers_owner",
"idxtype": "index", "idxtype": "index",
"idxfields": ["owner_id"] "idxfields": [
"owner_id"
]
}, },
{ {
"name": "idx_customers_name", "name": "idx_customers_name",
"idxtype": "index", "idxtype": "index",
"idxfields": ["customer_name"] "idxfields": [
"customer_name"
]
}, },
{ {
"name": "idx_customers_level", "name": "idx_customers_level",
"idxtype": "index", "idxtype": "index",
"idxfields": ["customer_level"] "idxfields": [
"customer_level"
]
}, },
{ {
"name": "idx_customers_status", "name": "idx_customers_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["status"] "idxfields": [
"status"
]
}, },
{ {
"name": "idx_customers_last_follow", "name": "idx_customers_last_follow",
"idxtype": "index", "idxtype": "index",
"idxfields": ["last_follow_up"] "idxfields": [
"last_follow_up"
]
} }
] ]
} }