{
  "name": "菜单",
  "table": {
    "name": "xiang_menu",
    "comment": "菜单表",
    "engine": "InnoDB"
  },
  "columns": [
    {
      "name": "id",
      "type": "ID",
      "comment": "ID"
    },
    {
      "name": "parent",
      "type": "bigInteger",
      "comment": "父节点",
      "nullable": true,
      "index": true
    },
    {
      "name": "name",
      "type": "string",
      "length": 200,
      "comment": "名称",
      "index": true
    },
    {
      "name": "icon",
      "type": "string",
      "length": 200,
      "comment": "图标",
      "nullable": true
    },
    {
      "name": "blocks",
      "type": "boolean",
      "comment": "block布局",
      "default": false,
      "index": true
    },
    {
      "name": "visible_menu",
      "type": "boolean",
      "comment": "显示",
      "default": false,
      "index": true
    },
    {
      "name": "path",
      "type": "string",
      "length": 200,
      "comment": "路由",
      "index": true
    },
    {
      "name": "rank",
      "type": "integer",
      "default": 9999,
      "comment": "排列",
      "index": true
    },
    {
      "label": "状态",
      "name": "status",
      "type": "enum",
      "default": "enabled",
      "option": ["enabled", "disabled"],
      "comment": "菜单状态 enabled 开启, disabled 关闭",
      "index": true
    }
  ],
  "relations": {
    "children": {
      "type": "hasMany",
      "model": "xiang.menu",
      "key": "parent",
      "foreign": "id",
      "query": {
        "select": ["name", "icon", "blocks", "path", "rank", "status"]
      }
    }
  },
  "values": [
    {
      "name": "数据看板",
      "path": "/kanban",
      "icon": "icon-activity",
      "rank": 1,
      "status": "enabled",
      "visible_menu": 0,
      "blocks": 1
    },
    {
      "name": "云服务库",
      "path": "/table/service",
      "icon": "icon-cloud",
      "rank": 2,
      "status": "enabled",
      "visible_menu": 0,
      "blocks": 0,
      "children": [
        {
          "name": "云服务库",
          "path": "/table/service",
          "icon": "icon-list"
        },
        {
          "name": "创建云服务库",
          "path": "/form/service/0",
          "icon": "icon-plus"
        }
      ]
    }
  ],
  "indexes": [],
  "option": {
    "timestamps": true,
    "soft_deletes": true
  }
}
