{
  "name": "云服务库",
  "table": {
    "name": "service",
    "comment": "云服务表",
    "engine": "InnoDB"
  },
  "columns": [
    { "name": "id", "type": "ID" },
    {
      "name": "short_name",
      "type": "string",
      "length": 200,
      "comment": "简称",
      "nullable": true,
      "index": true
    },
    {
      "name": "name",
      "type": "string",
      "length": 200,
      "comment": "服务名称",
      "index": true
    },
    {
      "name": "city",
      "type": "string",
      "length": 50,
      "comment": "城市",
      "nullable": true,
      "index": true
    },
    {
      "name": "kind_id",
      "type": "bigInteger",
      "length": 200,
      "comment": "服务类型",
      "index": true
    },
    {
      "name": "manu_id",
      "type": "bigInteger",
      "length": 200,
      "comment": "所属厂商",
      "index": true
    },
    {
      "name": "registed_at",
      "type": "string",
      "length": 200,
      "comment": "注册地",
      "nullable": true,
      "index": true
    },
    {
      "name": "link",
      "type": "string",
      "length": 200,
      "comment": "官网地址",
      "nullable": true
    },
    {
      "name": "contact_name",
      "type": "string",
      "length": 200,
      "comment": "联系人",
      "nullable": true,
      "index": true
    },
    {
      "name": "contact_mobile",
      "type": "string",
      "comment": "联系电话",
      "nullable": true,
      "index": true
    },
    {
      "name": "fields",
      "type": "json",
      "comment": "JSON|服务领域(多选)",
      "nullable": true,
      "index": true
    },
    {
      "name": "price_options",
      "type": "json",
      "length": 500,
      "nullable": true,
      "comment": "订阅方式(多选)",
      "index": true
    },
    {
      "name": "industries",
      "type": "json",
      "comment": "JSON|行业覆盖(多选)",
      "nullable": true,
      "index": true
    },
    {
      "name": "rank",
      "type": "integer",
      "default": 9999999,
      "comment": "查询排序"
    },
    {
      "name": "status",
      "type": "enum",
      "default": "enabled",
      "option": ["enabled", "disabled"],
      "comment": "状态 enabled 开启, disabled 关闭",
      "index": true
    }
  ],
  "relations": {
    "manu": {
      "type": "hasOne",
      "model": "manu",
      "key": "id",
      "foreign": "manu_id",
      "query": { "select": ["id", "name", "short_name", "status"] }
    },
    "kind": {
      "type": "hasOne",
      "model": "kind",
      "key": "id",
      "foreign": "kind_id",
      "query": { "select": ["id", "name"] }
    }
  },
  "option": { "timestamps": true, "soft_deletes": true },
  "values": [
    {
      "name": "腾讯云主机CVM",
      "city": "北京",
      "short_name": "云主机",
      "kind_id": 3,
      "manu_id": 1,
      "industries": ["教育", "能源"],
      "price_options": ["按月订阅"]
    },
    {
      "name": "腾讯云磁盘",
      "city": "广州",
      "short_name": "云磁盘",
      "kind_id": 6,
      "manu_id": 1,
      "industries": ["政府", "能源"],
      "price_options": ["按月订阅"]
    },
    {
      "name": "阿里主机",
      "city": "上海",
      "short_name": "云主机",
      "kind_id": 3,
      "manu_id": 2,
      "industries": ["教育", "医疗"],
      "price_options": ["按月订阅"]
    },
    {
      "name": "UCloud云主机",
      "short_name": "云主机",
      "city": "上海",
      "kind_id": 3,
      "manu_id": 3,
      "industries": ["软件", "医疗"],
      "price_options": ["按月订阅"]
    }
  ]
}
