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

This commit is contained in:
yumoqing 2026-05-27 13:23:29 +08:00
parent c8e79e85b7
commit 8f8a4dce90
4 changed files with 52 additions and 17 deletions

View File

@ -3,7 +3,9 @@
{ {
"name": "opportunities", "name": "opportunities",
"title": "商机表", "title": "商机表",
"primary": "id", "primary": [
"id"
],
"catelog": "entity" "catelog": "entity"
} }
], ],
@ -150,32 +152,44 @@
{ {
"name": "idx_opportunities_customer", "name": "idx_opportunities_customer",
"idxtype": "index", "idxtype": "index",
"idxfields": ["customer_id"] "idxfields": [
"customer_id"
]
}, },
{ {
"name": "idx_opportunities_owner", "name": "idx_opportunities_owner",
"idxtype": "index", "idxtype": "index",
"idxfields": ["owner_id"] "idxfields": [
"owner_id"
]
}, },
{ {
"name": "idx_opportunities_stage", "name": "idx_opportunities_stage",
"idxtype": "index", "idxtype": "index",
"idxfields": ["current_stage"] "idxfields": [
"current_stage"
]
}, },
{ {
"name": "idx_opportunities_region", "name": "idx_opportunities_region",
"idxtype": "index", "idxtype": "index",
"idxfields": ["region"] "idxfields": [
"region"
]
}, },
{ {
"name": "idx_opportunities_status", "name": "idx_opportunities_status",
"idxtype": "index", "idxtype": "index",
"idxfields": ["status"] "idxfields": [
"status"
]
}, },
{ {
"name": "idx_opportunities_expected_close", "name": "idx_opportunities_expected_close",
"idxtype": "index", "idxtype": "index",
"idxfields": ["expected_close_date"] "idxfields": [
"expected_close_date"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "opportunity_predictions", "name": "opportunity_predictions",
"title": "商机预测表", "title": "商机预测表",
"primary": "id", "primary": [
"id"
],
"catelog": "indication" "catelog": "indication"
} }
], ],
@ -81,12 +83,17 @@
{ {
"name": "idx_predictions_opportunity", "name": "idx_predictions_opportunity",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["opportunity_id", "prediction_date"] "idxfields": [
"opportunity_id",
"prediction_date"
]
}, },
{ {
"name": "idx_predictions_date", "name": "idx_predictions_date",
"idxtype": "index", "idxtype": "index",
"idxfields": ["prediction_date"] "idxfields": [
"prediction_date"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "opportunity_stage_history", "name": "opportunity_stage_history",
"title": "商机阶段变更历史表", "title": "商机阶段变更历史表",
"primary": "id", "primary": [
"id"
],
"catelog": "relation" "catelog": "relation"
} }
], ],
@ -74,17 +76,23 @@
{ {
"name": "idx_stage_history_opportunity", "name": "idx_stage_history_opportunity",
"idxtype": "index", "idxtype": "index",
"idxfields": ["opportunity_id"] "idxfields": [
"opportunity_id"
]
}, },
{ {
"name": "idx_stage_history_changed_by", "name": "idx_stage_history_changed_by",
"idxtype": "index", "idxtype": "index",
"idxfields": ["changed_by_id"] "idxfields": [
"changed_by_id"
]
}, },
{ {
"name": "idx_stage_history_changed_at", "name": "idx_stage_history_changed_at",
"idxtype": "index", "idxtype": "index",
"idxfields": ["changed_at"] "idxfields": [
"changed_at"
]
} }
] ]
} }

View File

@ -3,7 +3,9 @@
{ {
"name": "sales_stages", "name": "sales_stages",
"title": "销售阶段配置表", "title": "销售阶段配置表",
"primary": "id", "primary": [
"id"
],
"catelog": "dimession" "catelog": "dimession"
} }
], ],
@ -76,12 +78,16 @@
{ {
"name": "idx_sales_stages_order", "name": "idx_sales_stages_order",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["stage_order"] "idxfields": [
"stage_order"
]
}, },
{ {
"name": "idx_sales_stages_name", "name": "idx_sales_stages_name",
"idxtype": "unique", "idxtype": "unique",
"idxfields": ["stage_name"] "idxfields": [
"stage_name"
]
} }
] ]
} }