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

View File

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

View File

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

View File

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