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

This commit is contained in:
Hermes Agent 2026-05-27 13:23:31 +08:00
parent 40c480e488
commit 781216e11a
7 changed files with 884 additions and 807 deletions

View File

@ -1,162 +1,177 @@
{ {
"summary": [ "summary": [
{ {
"name": "accounting_records", "name": "accounting_records",
"title": "记账记录", "title": "记账记录",
"primary": "id", "primary": [
"classification": "business" "id"
} ],
], "classification": "business"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键" "nullable": false,
}, "default": "",
{ "comment": "主键",
"name": "customer_id", "length": 32
"type": "VARCHAR(32)", },
"nullable": false, {
"default": "", "name": "customer_id",
"comment": "客户ID" "type": "str",
}, "nullable": false,
{ "default": "",
"name": "llmid", "comment": "客户ID",
"type": "VARCHAR(32)", "length": 32
"nullable": true, },
"default": "", {
"comment": "模型ID" "name": "llmid",
}, "type": "str",
{ "nullable": true,
"name": "model_name", "default": "",
"type": "VARCHAR(128)", "comment": "模型ID",
"nullable": true, "length": 32
"default": "", },
"comment": "模型名称" {
}, "name": "model_name",
{ "type": "str",
"name": "pricing_id", "nullable": true,
"type": "VARCHAR(32)", "default": "",
"nullable": true, "comment": "模型名称",
"default": "", "length": 128
"comment": "定价ID" },
}, {
{ "name": "pricing_id",
"name": "input_tokens", "type": "str",
"type": "BIGINT", "nullable": true,
"nullable": true, "default": "",
"default": null, "comment": "定价ID",
"comment": "输入token数" "length": 32
}, },
{ {
"name": "output_tokens", "name": "input_tokens",
"type": "BIGINT", "type": "long",
"nullable": true, "nullable": true,
"default": null, "default": null,
"comment": "输出token数" "comment": "输入token数"
}, },
{ {
"name": "total_tokens", "name": "output_tokens",
"type": "BIGINT", "type": "long",
"nullable": true, "nullable": true,
"default": null, "default": null,
"comment": "总token数" "comment": "输出token数"
}, },
{ {
"name": "quantity", "name": "total_tokens",
"type": "DECIMAL(15,4)", "type": "long",
"nullable": true, "nullable": true,
"default": null, "default": null,
"comment": "用量(图片数/分钟数等)" "comment": "总token数"
}, },
{ {
"name": "amount", "name": "quantity",
"type": "DECIMAL(15,6)", "type": "double",
"nullable": false, "nullable": true,
"default": 0.0, "default": null,
"comment": "金额" "comment": "用量(图片数/分钟数等)",
}, "length": 15,
{ "dec": 4
"name": "currency", },
"type": "VARCHAR(8)", {
"nullable": false, "name": "amount",
"default": "CNY", "type": "double",
"comment": "货币单位" "nullable": false,
}, "default": 0.0,
{ "comment": "金额",
"name": "request_id", "length": 15,
"type": "VARCHAR(64)", "dec": 6
"nullable": true, },
"default": "", {
"comment": "请求ID幂等键" "name": "currency",
}, "type": "str",
{ "nullable": false,
"name": "transno", "default": "CNY",
"type": "VARCHAR(64)", "comment": "货币单位",
"nullable": true, "length": 8
"default": "", },
"comment": "事务号" {
}, "name": "request_id",
{ "type": "str",
"name": "status", "nullable": true,
"type": "VARCHAR(16)", "default": "",
"nullable": false, "comment": "请求ID幂等键",
"default": "pending", "length": 64
"comment": "状态: pending/accounted/failed" },
}, {
{ "name": "transno",
"name": "created_at", "type": "str",
"type": "DATETIME", "nullable": true,
"nullable": false, "default": "",
"default": "CURRENT_TIMESTAMP", "comment": "事务号",
"comment": "创建时间" "length": 64
}, },
{ {
"name": "updated_at", "name": "status",
"type": "DATETIME", "type": "str",
"nullable": false, "nullable": false,
"default": "CURRENT_TIMESTAMP", "default": "pending",
"comment": "更新时间" "comment": "状态: pending/accounted/failed",
} "length": 16
], },
"idxfields": [ {
{ "name": "created_at",
"name": "idx_customer_id", "type": "datetime",
"fields": [ "nullable": false,
"customer_id" "default": "CURRENT_TIMESTAMP",
], "comment": "创建时间"
"unique": false },
}, {
{ "name": "updated_at",
"name": "idx_llmid", "type": "datetime",
"fields": [ "nullable": false,
"llmid" "default": "CURRENT_TIMESTAMP",
], "comment": "更新时间"
"unique": false }
}, ],
{ "idxfields": [
"name": "idx_request_id", {
"fields": [ "name": "idx_customer_id",
"request_id" "fields": [
], "customer_id"
"unique": true ],
}, "unique": false
{ },
"name": "idx_status", {
"fields": [ "name": "idx_llmid",
"status" "fields": [
], "llmid"
"unique": false ],
}, "unique": false
{ },
"name": "idx_created_at", {
"fields": [ "name": "idx_request_id",
"created_at" "fields": [
], "request_id"
"unique": false ],
} "unique": true
], },
"codes": [] {
"name": "idx_status",
"fields": [
"status"
],
"unique": false
},
{
"name": "idx_created_at",
"fields": [
"created_at"
],
"unique": false
}
],
"codes": []
} }

View File

@ -1,92 +1,102 @@
{ {
"summary": [ "summary": [
{ {
"name": "customer_balance", "name": "customer_balance",
"title": "客户余额缓存", "title": "客户余额缓存",
"primary": "id", "primary": [
"classification": "cache" "id"
} ],
], "classification": "cache"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键,即 customer_id" "nullable": false,
}, "default": "",
{ "comment": "主键,即 customer_id",
"name": "balance", "length": 32
"type": "DECIMAL(15,4)", },
"nullable": false, {
"default": 0.0, "name": "balance",
"comment": "当前余额" "type": "double",
}, "nullable": false,
{ "default": 0.0,
"name": "currency", "comment": "当前余额",
"type": "VARCHAR(8)", "length": 15,
"nullable": false, "dec": 4
"default": "CNY", },
"comment": "货币单位" {
}, "name": "currency",
{ "type": "str",
"name": "credit_limit", "nullable": false,
"type": "DECIMAL(15,4)", "default": "CNY",
"nullable": true, "comment": "货币单位",
"default": null, "length": 8
"comment": "信用额度" },
}, {
{ "name": "credit_limit",
"name": "last_recharge", "type": "double",
"type": "DATETIME", "nullable": true,
"nullable": true, "default": null,
"default": null, "comment": "信用额度",
"comment": "最后充值时间" "length": 15,
}, "dec": 4
{ },
"name": "last_consumption", {
"type": "DATETIME", "name": "last_recharge",
"nullable": true, "type": "datetime",
"default": null, "nullable": true,
"comment": "最后消费时间" "default": null,
}, "comment": "最后充值时间"
{ },
"name": "status", {
"type": "VARCHAR(16)", "name": "last_consumption",
"nullable": false, "type": "datetime",
"default": "active", "nullable": true,
"comment": "状态: active/suspended/arrears" "default": null,
}, "comment": "最后消费时间"
{ },
"name": "sync_version", {
"type": "VARCHAR(32)", "name": "status",
"nullable": true, "type": "str",
"default": "", "nullable": false,
"comment": "同步版本号" "default": "active",
}, "comment": "状态: active/suspended/arrears",
{ "length": 16
"name": "cached_at", },
"type": "DATETIME", {
"nullable": false, "name": "sync_version",
"default": "CURRENT_TIMESTAMP", "type": "str",
"comment": "缓存更新时间" "nullable": true,
} "default": "",
], "comment": "同步版本号",
"idxfields": [ "length": 32
{ },
"name": "idx_status", {
"fields": [ "name": "cached_at",
"status" "type": "datetime",
], "nullable": false,
"unique": false "default": "CURRENT_TIMESTAMP",
}, "comment": "缓存更新时间"
{ }
"name": "idx_balance", ],
"fields": [ "idxfields": [
"balance" {
], "name": "idx_status",
"unique": false "fields": [
} "status"
], ],
"codes": [] "unique": false
},
{
"name": "idx_balance",
"fields": [
"balance"
],
"unique": false
}
],
"codes": []
} }

View File

@ -1,113 +1,123 @@
{ {
"summary": [ "summary": [
{ {
"name": "llmage_cache", "name": "llmage_cache",
"title": "模型API映射缓存", "title": "模型API映射缓存",
"primary": "id", "primary": [
"classification": "cache" "id"
} ],
], "classification": "cache"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键" "nullable": false,
}, "default": "",
{ "comment": "主键",
"name": "llmid", "length": 32
"type": "VARCHAR(32)", },
"nullable": false, {
"default": "", "name": "llmid",
"comment": "关联模型ID" "type": "str",
}, "nullable": false,
{ "default": "",
"name": "model_name", "comment": "关联模型ID",
"type": "VARCHAR(128)", "length": 32
"nullable": true, },
"default": "", {
"comment": "模型名称" "name": "model_name",
}, "type": "str",
{ "nullable": true,
"name": "upappid", "default": "",
"type": "VARCHAR(32)", "comment": "模型名称",
"nullable": false, "length": 128
"default": "", },
"comment": "上游应用ID" {
}, "name": "upappid",
{ "type": "str",
"name": "apiname", "nullable": false,
"type": "VARCHAR(128)", "default": "",
"nullable": false, "comment": "上游应用ID",
"default": "", "length": 32
"comment": "API名称" },
}, {
{ "name": "apiname",
"name": "api_url", "type": "str",
"type": "VARCHAR(512)", "nullable": false,
"nullable": true, "default": "",
"default": "", "comment": "API名称",
"comment": "API端点URL" "length": 128
}, },
{ {
"name": "api_params", "name": "api_url",
"type": "TEXT", "type": "str",
"nullable": true, "nullable": true,
"default": null, "default": "",
"comment": "API参数配置JSON" "comment": "API端点URL",
}, "length": 512
{ },
"name": "model_params", {
"type": "TEXT", "name": "api_params",
"nullable": true, "type": "text",
"default": null, "nullable": true,
"comment": "模型参数配置JSONmax_tokens, temperature等" "default": null,
}, "comment": "API参数配置JSON"
{ },
"name": "status", {
"type": "VARCHAR(16)", "name": "model_params",
"nullable": false, "type": "text",
"default": "active", "nullable": true,
"comment": "状态: active/inactive" "default": null,
}, "comment": "模型参数配置JSONmax_tokens, temperature等"
{ },
"name": "sync_version", {
"type": "VARCHAR(32)", "name": "status",
"nullable": true, "type": "str",
"default": "", "nullable": false,
"comment": "同步版本号" "default": "active",
}, "comment": "状态: active/inactive",
{ "length": 16
"name": "cached_at", },
"type": "DATETIME", {
"nullable": false, "name": "sync_version",
"default": "CURRENT_TIMESTAMP", "type": "str",
"comment": "缓存写入时间" "nullable": true,
} "default": "",
], "comment": "同步版本号",
"idxfields": [ "length": 32
{ },
"name": "idx_llmid", {
"fields": [ "name": "cached_at",
"llmid" "type": "datetime",
], "nullable": false,
"unique": false "default": "CURRENT_TIMESTAMP",
}, "comment": "缓存写入时间"
{ }
"name": "idx_upappid", ],
"fields": [ "idxfields": [
"upappid" {
], "name": "idx_llmid",
"unique": false "fields": [
}, "llmid"
{ ],
"name": "idx_apiname", "unique": false
"fields": [ },
"apiname" {
], "name": "idx_upappid",
"unique": false "fields": [
} "upappid"
], ],
"codes": [] "unique": false
},
{
"name": "idx_apiname",
"fields": [
"apiname"
],
"unique": false
}
],
"codes": []
} }

View File

@ -1,127 +1,142 @@
{ {
"summary": [ "summary": [
{ {
"name": "pricing_cache", "name": "pricing_cache",
"title": "定价数据缓存", "title": "定价数据缓存",
"primary": "id", "primary": [
"classification": "cache" "id"
} ],
], "classification": "cache"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键,对应 pricing_program id (ppid)" "nullable": false,
}, "default": "",
{ "comment": "主键,对应 pricing_program id (ppid)",
"name": "llmid", "length": 32
"type": "VARCHAR(32)", },
"nullable": false, {
"default": "", "name": "llmid",
"comment": "关联模型ID" "type": "str",
}, "nullable": false,
{ "default": "",
"name": "model_name", "comment": "关联模型ID",
"type": "VARCHAR(128)", "length": 32
"nullable": true, },
"default": "", {
"comment": "模型名称" "name": "model_name",
}, "type": "str",
{ "nullable": true,
"name": "pricing_type", "default": "",
"type": "VARCHAR(32)", "comment": "模型名称",
"nullable": false, "length": 128
"default": "", },
"comment": "计费类型: token/image/video/audio" {
}, "name": "pricing_type",
{ "type": "str",
"name": "input_price", "nullable": false,
"type": "DECIMAL(10,6)", "default": "",
"nullable": true, "comment": "计费类型: token/image/video/audio",
"default": null, "length": 32
"comment": "输入单价每千token" },
}, {
{ "name": "input_price",
"name": "output_price", "type": "double",
"type": "DECIMAL(10,6)", "nullable": true,
"nullable": true, "default": null,
"default": null, "comment": "输入单价每千token",
"comment": "输出单价每千token" "length": 10,
}, "dec": 6
{ },
"name": "unit_price", {
"type": "DECIMAL(10,6)", "name": "output_price",
"nullable": true, "type": "double",
"default": null, "nullable": true,
"comment": "统一单价(按次/按图/按分钟等)" "default": null,
}, "comment": "输出单价每千token",
{ "length": 10,
"name": "currency", "dec": 6
"type": "VARCHAR(8)", },
"nullable": false, {
"default": "CNY", "name": "unit_price",
"comment": "货币单位" "type": "double",
}, "nullable": true,
{ "default": null,
"name": "status", "comment": "统一单价(按次/按图/按分钟等)",
"type": "VARCHAR(16)", "length": 10,
"nullable": false, "dec": 6
"default": "active", },
"comment": "状态: active/inactive/deprecated" {
}, "name": "currency",
{ "type": "str",
"name": "effective_from", "nullable": false,
"type": "DATETIME", "default": "CNY",
"nullable": true, "comment": "货币单位",
"default": null, "length": 8
"comment": "生效时间" },
}, {
{ "name": "status",
"name": "effective_to", "type": "str",
"type": "DATETIME", "nullable": false,
"nullable": true, "default": "active",
"default": null, "comment": "状态: active/inactive/deprecated",
"comment": "失效时间" "length": 16
}, },
{ {
"name": "sync_version", "name": "effective_from",
"type": "VARCHAR(32)", "type": "datetime",
"nullable": true, "nullable": true,
"default": "", "default": null,
"comment": "同步版本号" "comment": "生效时间"
}, },
{ {
"name": "cached_at", "name": "effective_to",
"type": "DATETIME", "type": "datetime",
"nullable": false, "nullable": true,
"default": "CURRENT_TIMESTAMP", "default": null,
"comment": "缓存写入时间" "comment": "失效时间"
} },
], {
"idxfields": [ "name": "sync_version",
{ "type": "str",
"name": "idx_llmid", "nullable": true,
"fields": [ "default": "",
"llmid" "comment": "同步版本号",
], "length": 32
"unique": false },
}, {
{ "name": "cached_at",
"name": "idx_pricing_type", "type": "datetime",
"fields": [ "nullable": false,
"pricing_type" "default": "CURRENT_TIMESTAMP",
], "comment": "缓存写入时间"
"unique": false }
}, ],
{ "idxfields": [
"name": "idx_status", {
"fields": [ "name": "idx_llmid",
"status" "fields": [
], "llmid"
"unique": false ],
} "unique": false
], },
"codes": [] {
"name": "idx_pricing_type",
"fields": [
"pricing_type"
],
"unique": false
},
{
"name": "idx_status",
"fields": [
"status"
],
"unique": false
}
],
"codes": []
} }

View File

@ -1,107 +1,114 @@
{ {
"summary": [ "summary": [
{ {
"name": "sync_state", "name": "sync_state",
"title": "同步状态跟踪", "title": "同步状态跟踪",
"primary": "id", "primary": [
"classification": "system" "id"
} ],
], "classification": "system"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键" "nullable": false,
}, "default": "",
{ "comment": "主键",
"name": "entity_type", "length": 32
"type": "VARCHAR(32)", },
"nullable": false, {
"default": "", "name": "entity_type",
"comment": "实体类型: users/pricing/llmage/uapi" "type": "str",
}, "nullable": false,
{ "default": "",
"name": "entity_id", "comment": "实体类型: users/pricing/llmage/uapi",
"type": "VARCHAR(64)", "length": 32
"nullable": true, },
"default": "", {
"comment": "实体标识(全量同步时为空)" "name": "entity_id",
}, "type": "str",
{ "nullable": true,
"name": "last_sync_time", "default": "",
"type": "DATETIME", "comment": "实体标识(全量同步时为空)",
"nullable": true, "length": 64
"default": null, },
"comment": "最后同步时间" {
}, "name": "last_sync_time",
{ "type": "datetime",
"name": "sync_version", "nullable": true,
"type": "VARCHAR(32)", "default": null,
"nullable": true, "comment": "最后同步时间"
"default": "", },
"comment": "Sage返回的版本标识" {
}, "name": "sync_version",
{ "type": "str",
"name": "sync_status", "nullable": true,
"type": "VARCHAR(16)", "default": "",
"nullable": false, "comment": "Sage返回的版本标识",
"default": "success", "length": 32
"comment": "同步状态: success/pending/failed" },
}, {
{ "name": "sync_status",
"name": "error_msg", "type": "str",
"type": "TEXT", "nullable": false,
"nullable": true, "default": "success",
"default": null, "comment": "同步状态: success/pending/failed",
"comment": "失败原因" "length": 16
}, },
{ {
"name": "retry_count", "name": "error_msg",
"type": "INT", "type": "text",
"nullable": false, "nullable": true,
"default": 0, "default": null,
"comment": "重试次数" "comment": "失败原因"
}, },
{ {
"name": "created_at", "name": "retry_count",
"type": "DATETIME", "type": "int",
"nullable": false, "nullable": false,
"default": "CURRENT_TIMESTAMP", "default": 0,
"comment": "创建时间" "comment": "重试次数"
}, },
{ {
"name": "updated_at", "name": "created_at",
"type": "DATETIME", "type": "datetime",
"nullable": false, "nullable": false,
"default": "CURRENT_TIMESTAMP", "default": "CURRENT_TIMESTAMP",
"comment": "更新时间" "comment": "创建时间"
} },
], {
"idxfields": [ "name": "updated_at",
{ "type": "datetime",
"name": "idx_entity_type", "nullable": false,
"fields": [ "default": "CURRENT_TIMESTAMP",
"entity_type" "comment": "更新时间"
], }
"unique": false ],
}, "idxfields": [
{ {
"name": "idx_entity_type_id", "name": "idx_entity_type",
"fields": [ "fields": [
"entity_type", "entity_type"
"entity_id" ],
], "unique": false
"unique": true },
}, {
{ "name": "idx_entity_type_id",
"name": "idx_sync_status", "fields": [
"fields": [ "entity_type",
"sync_status" "entity_id"
], ],
"unique": false "unique": true
} },
], {
"codes": [] "name": "idx_sync_status",
"fields": [
"sync_status"
],
"unique": false
}
],
"codes": []
} }

View File

@ -1,107 +1,117 @@
{ {
"summary": [ "summary": [
{ {
"name": "uapi_cache", "name": "uapi_cache",
"title": "uapi定义缓存", "title": "uapi定义缓存",
"primary": "id", "primary": [
"classification": "cache" "id"
} ],
], "classification": "cache"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键" "nullable": false,
}, "default": "",
{ "comment": "主键",
"name": "upappid", "length": 32
"type": "VARCHAR(32)", },
"nullable": false, {
"default": "", "name": "upappid",
"comment": "上游应用ID" "type": "str",
}, "nullable": false,
{ "default": "",
"name": "apiname", "comment": "上游应用ID",
"type": "VARCHAR(128)", "length": 32
"nullable": false, },
"default": "", {
"comment": "API名称" "name": "apiname",
}, "type": "str",
{ "nullable": false,
"name": "method", "default": "",
"type": "VARCHAR(16)", "comment": "API名称",
"nullable": true, "length": 128
"default": "POST", },
"comment": "HTTP方法" {
}, "name": "method",
{ "type": "str",
"name": "endpoint", "nullable": true,
"type": "VARCHAR(512)", "default": "POST",
"nullable": true, "comment": "HTTP方法",
"default": "", "length": 16
"comment": "API端点" },
}, {
{ "name": "endpoint",
"name": "auth_type", "type": "str",
"type": "VARCHAR(32)", "nullable": true,
"nullable": true, "default": "",
"default": "bearer", "comment": "API端点",
"comment": "认证类型" "length": 512
}, },
{ {
"name": "rate_limit", "name": "auth_type",
"type": "INT", "type": "str",
"nullable": true, "nullable": true,
"default": null, "default": "bearer",
"comment": "速率限制(次/分钟)" "comment": "认证类型",
}, "length": 32
{ },
"name": "description", {
"type": "TEXT", "name": "rate_limit",
"nullable": true, "type": "int",
"default": null, "nullable": true,
"comment": "API描述" "default": null,
}, "comment": "速率限制(次/分钟)"
{ },
"name": "status", {
"type": "VARCHAR(16)", "name": "description",
"nullable": false, "type": "text",
"default": "active", "nullable": true,
"comment": "状态" "default": null,
}, "comment": "API描述"
{ },
"name": "sync_version", {
"type": "VARCHAR(32)", "name": "status",
"nullable": true, "type": "str",
"default": "", "nullable": false,
"comment": "同步版本号" "default": "active",
}, "comment": "状态",
{ "length": 16
"name": "cached_at", },
"type": "DATETIME", {
"nullable": false, "name": "sync_version",
"default": "CURRENT_TIMESTAMP", "type": "str",
"comment": "缓存写入时间" "nullable": true,
} "default": "",
], "comment": "同步版本号",
"idxfields": [ "length": 32
{ },
"name": "idx_upappid_apiname", {
"fields": [ "name": "cached_at",
"upappid", "type": "datetime",
"apiname" "nullable": false,
], "default": "CURRENT_TIMESTAMP",
"unique": true "comment": "缓存写入时间"
}, }
{ ],
"name": "idx_status", "idxfields": [
"fields": [ {
"status" "name": "idx_upappid_apiname",
], "fields": [
"unique": false "upappid",
} "apiname"
], ],
"codes": [] "unique": true
},
{
"name": "idx_status",
"fields": [
"status"
],
"unique": false
}
],
"codes": []
} }

View File

@ -1,113 +1,123 @@
{ {
"summary": [ "summary": [
{ {
"name": "users_cache", "name": "users_cache",
"title": "用户数据缓存", "title": "用户数据缓存",
"primary": "id", "primary": [
"classification": "cache" "id"
} ],
], "classification": "cache"
"fields": [ }
{ ],
"name": "id", "fields": [
"type": "VARCHAR(32)", {
"nullable": false, "name": "id",
"default": "", "type": "str",
"comment": "主键,对应 users 表 id" "nullable": false,
}, "default": "",
{ "comment": "主键,对应 users 表 id",
"name": "username", "length": 32
"type": "VARCHAR(128)", },
"nullable": false, {
"default": "", "name": "username",
"comment": "用户名" "type": "str",
}, "nullable": false,
{ "default": "",
"name": "orgid", "comment": "用户名",
"type": "VARCHAR(32)", "length": 128
"nullable": true, },
"default": "", {
"comment": "组织ID" "name": "orgid",
}, "type": "str",
{ "nullable": true,
"name": "orgname", "default": "",
"type": "VARCHAR(255)", "comment": "组织ID",
"nullable": true, "length": 32
"default": "", },
"comment": "组织名称" {
}, "name": "orgname",
{ "type": "str",
"name": "email", "nullable": true,
"type": "VARCHAR(128)", "default": "",
"nullable": true, "comment": "组织名称",
"default": "", "length": 255
"comment": "邮箱" },
}, {
{ "name": "email",
"name": "phone", "type": "str",
"type": "VARCHAR(32)", "nullable": true,
"nullable": true, "default": "",
"default": "", "comment": "邮箱",
"comment": "手机号" "length": 128
}, },
{ {
"name": "status", "name": "phone",
"type": "VARCHAR(16)", "type": "str",
"nullable": false, "nullable": true,
"default": "active", "default": "",
"comment": "状态: active/inactive/suspended" "comment": "手机号",
}, "length": 32
{ },
"name": "created_at", {
"type": "DATETIME", "name": "status",
"nullable": true, "type": "str",
"default": null, "nullable": false,
"comment": "创建时间" "default": "active",
}, "comment": "状态: active/inactive/suspended",
{ "length": 16
"name": "updated_at", },
"type": "DATETIME", {
"nullable": true, "name": "created_at",
"default": null, "type": "datetime",
"comment": "更新时间" "nullable": true,
}, "default": null,
{ "comment": "创建时间"
"name": "sync_version", },
"type": "VARCHAR(32)", {
"nullable": true, "name": "updated_at",
"default": "", "type": "datetime",
"comment": "同步版本号" "nullable": true,
}, "default": null,
{ "comment": "更新时间"
"name": "cached_at", },
"type": "DATETIME", {
"nullable": false, "name": "sync_version",
"default": "CURRENT_TIMESTAMP", "type": "str",
"comment": "缓存写入时间" "nullable": true,
} "default": "",
], "comment": "同步版本号",
"idxfields": [ "length": 32
{ },
"name": "idx_username", {
"fields": [ "name": "cached_at",
"username" "type": "datetime",
], "nullable": false,
"unique": false "default": "CURRENT_TIMESTAMP",
}, "comment": "缓存写入时间"
{ }
"name": "idx_orgid", ],
"fields": [ "idxfields": [
"orgid" {
], "name": "idx_username",
"unique": false "fields": [
}, "username"
{ ],
"name": "idx_sync_version", "unique": false
"fields": [ },
"sync_version" {
], "name": "idx_orgid",
"unique": false "fields": [
} "orgid"
], ],
"codes": [] "unique": false
},
{
"name": "idx_sync_version",
"fields": [
"sync_version"
],
"unique": false
}
],
"codes": []
} }