schema.go 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. // Code generated by ent, DO NOT EDIT.
  2. package migrate
  3. import (
  4. "entgo.io/ent/dialect/entsql"
  5. "entgo.io/ent/dialect/sql/schema"
  6. "entgo.io/ent/schema/field"
  7. )
  8. var (
  9. // AgentColumns holds the columns for the "agent" table.
  10. AgentColumns = []*schema.Column{
  11. {Name: "id", Type: field.TypeUint64, Increment: true},
  12. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  13. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  14. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  15. {Name: "name", Type: field.TypeString, Size: 255, Comment: "name | 角色名称"},
  16. {Name: "role", Type: field.TypeString, Comment: "role | 角色设定"},
  17. {Name: "status", Type: field.TypeInt, Nullable: true, Comment: "status | 状态 1-正常 2-禁用", Default: 1},
  18. {Name: "background", Type: field.TypeString, Nullable: true, Comment: "background | 背景介绍", Default: ""},
  19. {Name: "examples", Type: field.TypeString, Nullable: true, Comment: "examples | 对话案例", Default: ""},
  20. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  21. {Name: "dataset_id", Type: field.TypeString, Size: 255, Comment: "dataset_id | 知识库ID", Default: ""},
  22. {Name: "collection_id", Type: field.TypeString, Size: 255, Comment: "collection_id | 集合ID", Default: ""},
  23. }
  24. // AgentTable holds the schema information for the "agent" table.
  25. AgentTable = &schema.Table{
  26. Name: "agent",
  27. Columns: AgentColumns,
  28. PrimaryKey: []*schema.Column{AgentColumns[0]},
  29. Indexes: []*schema.Index{
  30. {
  31. Name: "agent_organization_id",
  32. Unique: false,
  33. Columns: []*schema.Column{AgentColumns[9]},
  34. },
  35. },
  36. }
  37. // AgentBaseColumns holds the columns for the "agent_base" table.
  38. AgentBaseColumns = []*schema.Column{
  39. {Name: "id", Type: field.TypeString, Comment: "id"},
  40. {Name: "q", Type: field.TypeString, Nullable: true, Comment: "q", Default: ""},
  41. {Name: "a", Type: field.TypeString, Nullable: true, Comment: "a", Default: ""},
  42. {Name: "chunk_index", Type: field.TypeUint64, Comment: "chunk_index"},
  43. {Name: "indexes", Type: field.TypeJSON, Nullable: true, Comment: "indexes"},
  44. {Name: "dataset_id", Type: field.TypeString, Nullable: true, Comment: "dataset_id", Default: ""},
  45. {Name: "collection_id", Type: field.TypeString, Nullable: true, Comment: "collection_id", Default: ""},
  46. {Name: "source_name", Type: field.TypeString, Nullable: true, Comment: "source_name", Default: ""},
  47. {Name: "can_write", Type: field.TypeJSON, Nullable: true, Comment: "can_write"},
  48. {Name: "is_owner", Type: field.TypeJSON, Nullable: true, Comment: "is_owner"},
  49. }
  50. // AgentBaseTable holds the schema information for the "agent_base" table.
  51. AgentBaseTable = &schema.Table{
  52. Name: "agent_base",
  53. Columns: AgentBaseColumns,
  54. PrimaryKey: []*schema.Column{AgentBaseColumns[0]},
  55. }
  56. // AliyunAvatarColumns holds the columns for the "aliyun_avatar" table.
  57. AliyunAvatarColumns = []*schema.Column{
  58. {Name: "id", Type: field.TypeUint64, Increment: true},
  59. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  60. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  61. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  62. {Name: "user_id", Type: field.TypeUint64, Comment: "user_id | wx_card_user_id"},
  63. {Name: "biz_id", Type: field.TypeString, Comment: "biz_id | BizId"},
  64. {Name: "access_key_id", Type: field.TypeString, Comment: "access_key_id | AccessKeyId"},
  65. {Name: "access_key_secret", Type: field.TypeString, Comment: "access_key_secret | AccessKeySecret"},
  66. {Name: "app_id", Type: field.TypeString, Nullable: true, Comment: "app_id | AppId"},
  67. {Name: "tenant_id", Type: field.TypeUint64, Comment: "tenant_id | TenantId"},
  68. {Name: "response", Type: field.TypeString, Size: 2147483647, Comment: "response | 阿里云avatar响应"},
  69. {Name: "token", Type: field.TypeString, Comment: "token | Token", Default: ""},
  70. {Name: "session_id", Type: field.TypeString, Comment: "session_id | SessionId", Default: ""},
  71. }
  72. // AliyunAvatarTable holds the schema information for the "aliyun_avatar" table.
  73. AliyunAvatarTable = &schema.Table{
  74. Name: "aliyun_avatar",
  75. Columns: AliyunAvatarColumns,
  76. PrimaryKey: []*schema.Column{AliyunAvatarColumns[0]},
  77. Indexes: []*schema.Index{
  78. {
  79. Name: "aliyunavatar_user_id",
  80. Unique: false,
  81. Columns: []*schema.Column{AliyunAvatarColumns[4]},
  82. },
  83. },
  84. }
  85. // BatchMsgColumns holds the columns for the "batch_msg" table.
  86. BatchMsgColumns = []*schema.Column{
  87. {Name: "id", Type: field.TypeUint64, Increment: true},
  88. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  89. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  90. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  91. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "状态 0 未开始 1 开始发送 2 发送完成 3 发送中止"},
  92. {Name: "batch_no", Type: field.TypeString, Unique: true, Nullable: true, Comment: "批次号"},
  93. {Name: "task_name", Type: field.TypeString, Nullable: true, Comment: "任务名称", Default: ""},
  94. {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
  95. {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "内容"},
  96. {Name: "tag", Type: field.TypeString, Nullable: true, Comment: "发送规则 all 全部 tag1,tag2 按tag发送"},
  97. {Name: "tagids", Type: field.TypeString, Nullable: true, Comment: "要发送的tagids"},
  98. {Name: "total", Type: field.TypeInt32, Nullable: true, Comment: "总数"},
  99. {Name: "success", Type: field.TypeInt32, Nullable: true, Comment: "成功数量"},
  100. {Name: "fail", Type: field.TypeInt32, Nullable: true, Comment: "失败数量"},
  101. {Name: "start_time", Type: field.TypeTime, Nullable: true, Comment: "开始时间"},
  102. {Name: "stop_time", Type: field.TypeTime, Nullable: true, Comment: "结束时间"},
  103. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  104. {Name: "type", Type: field.TypeInt32, Nullable: true, Comment: "发送类型 1-群发消息 2-群发朋友圈"},
  105. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  106. }
  107. // BatchMsgTable holds the schema information for the "batch_msg" table.
  108. BatchMsgTable = &schema.Table{
  109. Name: "batch_msg",
  110. Columns: BatchMsgColumns,
  111. PrimaryKey: []*schema.Column{BatchMsgColumns[0]},
  112. Indexes: []*schema.Index{
  113. {
  114. Name: "batchmsg_batch_no",
  115. Unique: true,
  116. Columns: []*schema.Column{BatchMsgColumns[5]},
  117. },
  118. {
  119. Name: "batchmsg_type",
  120. Unique: false,
  121. Columns: []*schema.Column{BatchMsgColumns[17]},
  122. },
  123. },
  124. }
  125. // CategoryColumns holds the columns for the "category" table.
  126. CategoryColumns = []*schema.Column{
  127. {Name: "id", Type: field.TypeUint64, Increment: true},
  128. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  129. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  130. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  131. {Name: "name", Type: field.TypeString, Size: 255, Comment: "name | 角色名称"},
  132. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  133. }
  134. // CategoryTable holds the schema information for the "category" table.
  135. CategoryTable = &schema.Table{
  136. Name: "category",
  137. Columns: CategoryColumns,
  138. PrimaryKey: []*schema.Column{CategoryColumns[0]},
  139. Indexes: []*schema.Index{
  140. {
  141. Name: "category_organization_id",
  142. Unique: false,
  143. Columns: []*schema.Column{CategoryColumns[5]},
  144. },
  145. },
  146. }
  147. // ChatRecordsColumns holds the columns for the "chat_records" table.
  148. ChatRecordsColumns = []*schema.Column{
  149. {Name: "id", Type: field.TypeUint64, Increment: true},
  150. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  151. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  152. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  153. {Name: "content", Type: field.TypeString, Comment: "内容", Default: ""},
  154. {Name: "content_type", Type: field.TypeUint8, Comment: "内容类型:1-提问 2-回答", Default: 1},
  155. {Name: "session_id", Type: field.TypeUint64, Comment: "会话ID", Default: 0},
  156. {Name: "user_id", Type: field.TypeUint64, Comment: "用户ID", Default: 0},
  157. {Name: "bot_id", Type: field.TypeUint64, Comment: "聊天ID", Default: 0},
  158. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序card 3-智能体", Default: 2},
  159. }
  160. // ChatRecordsTable holds the schema information for the "chat_records" table.
  161. ChatRecordsTable = &schema.Table{
  162. Name: "chat_records",
  163. Columns: ChatRecordsColumns,
  164. PrimaryKey: []*schema.Column{ChatRecordsColumns[0]},
  165. Indexes: []*schema.Index{
  166. {
  167. Name: "chatrecords_user_id_bot_id_bot_type",
  168. Unique: false,
  169. Columns: []*schema.Column{ChatRecordsColumns[7], ChatRecordsColumns[8], ChatRecordsColumns[9]},
  170. },
  171. {
  172. Name: "chatrecords_session_id",
  173. Unique: false,
  174. Columns: []*schema.Column{ChatRecordsColumns[6]},
  175. },
  176. },
  177. }
  178. // ChatSessionColumns holds the columns for the "chat_session" table.
  179. ChatSessionColumns = []*schema.Column{
  180. {Name: "id", Type: field.TypeUint64, Increment: true},
  181. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  182. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  183. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  184. {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
  185. {Name: "user_id", Type: field.TypeUint64, Comment: "用户ID", Default: 0},
  186. {Name: "bot_id", Type: field.TypeUint64, Comment: "聊天ID", Default: 0},
  187. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序card 3-智能体", Default: 2},
  188. }
  189. // ChatSessionTable holds the schema information for the "chat_session" table.
  190. ChatSessionTable = &schema.Table{
  191. Name: "chat_session",
  192. Columns: ChatSessionColumns,
  193. PrimaryKey: []*schema.Column{ChatSessionColumns[0]},
  194. Indexes: []*schema.Index{
  195. {
  196. Name: "chatsession_user_id_bot_id_bot_type",
  197. Unique: false,
  198. Columns: []*schema.Column{ChatSessionColumns[5], ChatSessionColumns[6], ChatSessionColumns[7]},
  199. },
  200. },
  201. }
  202. // ContactColumns holds the columns for the "contact" table.
  203. ContactColumns = []*schema.Column{
  204. {Name: "id", Type: field.TypeUint64, Increment: true},
  205. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  206. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  207. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  208. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  209. {Name: "wx_wxid", Type: field.TypeString, Comment: "属主微信id", Default: ""},
  210. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "联系人类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  211. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  212. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  213. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称 群备注名称", Default: ""},
  214. {Name: "markname", Type: field.TypeString, Comment: "备注名", Default: ""},
  215. {Name: "headimg", Type: field.TypeString, Comment: "头像", Default: ""},
  216. {Name: "sex", Type: field.TypeInt, Comment: "性别 0未知 1男 2女", Default: 0},
  217. {Name: "starrole", Type: field.TypeString, Comment: "星标 65/67=星标 1/3=未星标", Default: ""},
  218. {Name: "dontseeit", Type: field.TypeInt, Comment: "不让他看我的朋友圈 0可以看 1不让看", Default: 0},
  219. {Name: "dontseeme", Type: field.TypeInt, Comment: "不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天", Default: 0},
  220. {Name: "lag", Type: field.TypeString, Comment: "所属标签id清单,多开会用逗号隔开", Default: ""},
  221. {Name: "gid", Type: field.TypeString, Comment: "群组id", Default: ""},
  222. {Name: "gname", Type: field.TypeString, Comment: "群组名称", Default: ""},
  223. {Name: "v3", Type: field.TypeString, Comment: "v3数据", Default: ""},
  224. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  225. }
  226. // ContactTable holds the schema information for the "contact" table.
  227. ContactTable = &schema.Table{
  228. Name: "contact",
  229. Columns: ContactColumns,
  230. PrimaryKey: []*schema.Column{ContactColumns[0]},
  231. Indexes: []*schema.Index{
  232. {
  233. Name: "contact_wx_wxid_wxid",
  234. Unique: true,
  235. Columns: []*schema.Column{ContactColumns[5], ContactColumns[7]},
  236. },
  237. {
  238. Name: "contact_wxid",
  239. Unique: false,
  240. Columns: []*schema.Column{ContactColumns[7]},
  241. },
  242. {
  243. Name: "contact_type",
  244. Unique: false,
  245. Columns: []*schema.Column{ContactColumns[6]},
  246. },
  247. {
  248. Name: "contact_gid",
  249. Unique: false,
  250. Columns: []*schema.Column{ContactColumns[17]},
  251. },
  252. },
  253. }
  254. // EmployeeColumns holds the columns for the "employee" table.
  255. EmployeeColumns = []*schema.Column{
  256. {Name: "id", Type: field.TypeUint64, Increment: true},
  257. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  258. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  259. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  260. {Name: "title", Type: field.TypeString, Size: 1000, Comment: "title | 标题"},
  261. {Name: "avatar", Type: field.TypeString, Comment: "avatar | 头像"},
  262. {Name: "tags", Type: field.TypeString, Comment: "tags | 个人标签"},
  263. {Name: "hire_count", Type: field.TypeInt, Comment: "hire_count | 被雇佣次数", Default: 0},
  264. {Name: "service_count", Type: field.TypeInt, Comment: "service_count | 已服务次数", Default: 0},
  265. {Name: "achievement_count", Type: field.TypeInt, Comment: "achievement_count | 业绩单数", Default: 0},
  266. {Name: "intro", Type: field.TypeString, Comment: "intro | 个人介绍", Default: ""},
  267. {Name: "estimate", Type: field.TypeString, Comment: "estimate | 自我评价", Default: ""},
  268. {Name: "skill", Type: field.TypeString, Comment: "skill | 技能卡", Default: ""},
  269. {Name: "ability_type", Type: field.TypeString, Comment: "ability_type | 能力类型", Default: ""},
  270. {Name: "scene", Type: field.TypeString, Comment: "scene | 使用场景", Default: ""},
  271. {Name: "switch_in", Type: field.TypeString, Comment: "switch_in | 支持介入", Default: ""},
  272. {Name: "video_url", Type: field.TypeString, Comment: "video_url | 视频地址", Default: ""},
  273. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  274. {Name: "category_id", Type: field.TypeUint64, Comment: "category_id | 分类ID"},
  275. {Name: "api_base", Type: field.TypeString, Comment: "api_base", Default: ""},
  276. {Name: "api_key", Type: field.TypeString, Comment: "api_key", Default: ""},
  277. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  278. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  279. {Name: "chat_url", Type: field.TypeString, Comment: "聊天URL"},
  280. }
  281. // EmployeeTable holds the schema information for the "employee" table.
  282. EmployeeTable = &schema.Table{
  283. Name: "employee",
  284. Columns: EmployeeColumns,
  285. PrimaryKey: []*schema.Column{EmployeeColumns[0]},
  286. Indexes: []*schema.Index{
  287. {
  288. Name: "employee_organization_id",
  289. Unique: false,
  290. Columns: []*schema.Column{EmployeeColumns[17]},
  291. },
  292. },
  293. }
  294. // EmployeeConfigColumns holds the columns for the "employee_config" table.
  295. EmployeeConfigColumns = []*schema.Column{
  296. {Name: "id", Type: field.TypeUint64, Increment: true},
  297. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  298. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  299. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  300. {Name: "stype", Type: field.TypeString, Comment: "类型:scene-场景 switch_in-接入方式", Default: ""},
  301. {Name: "title", Type: field.TypeString, Comment: "标题", Default: ""},
  302. {Name: "photo", Type: field.TypeString, Comment: "图片地址", Default: ""},
  303. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  304. }
  305. // EmployeeConfigTable holds the schema information for the "employee_config" table.
  306. EmployeeConfigTable = &schema.Table{
  307. Name: "employee_config",
  308. Columns: EmployeeConfigColumns,
  309. PrimaryKey: []*schema.Column{EmployeeConfigColumns[0]},
  310. Indexes: []*schema.Index{
  311. {
  312. Name: "employeeconfig_stype",
  313. Unique: false,
  314. Columns: []*schema.Column{EmployeeConfigColumns[4]},
  315. },
  316. },
  317. }
  318. // LabelColumns holds the columns for the "label" table.
  319. LabelColumns = []*schema.Column{
  320. {Name: "id", Type: field.TypeUint64, Increment: true},
  321. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  322. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  323. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  324. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  325. {Name: "name", Type: field.TypeString, Comment: "标签名称", Default: ""},
  326. {Name: "from", Type: field.TypeInt, Comment: "标签来源:1后台创建 2个微同步", Default: 1},
  327. {Name: "mode", Type: field.TypeInt, Comment: "标签模式:1动态 2静态", Default: 1},
  328. {Name: "conditions", Type: field.TypeString, Nullable: true, Comment: "标签的触达条件", Default: ""},
  329. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  330. }
  331. // LabelTable holds the schema information for the "label" table.
  332. LabelTable = &schema.Table{
  333. Name: "label",
  334. Columns: LabelColumns,
  335. PrimaryKey: []*schema.Column{LabelColumns[0]},
  336. Indexes: []*schema.Index{
  337. {
  338. Name: "label_name_from_mode",
  339. Unique: true,
  340. Columns: []*schema.Column{LabelColumns[5], LabelColumns[6], LabelColumns[7]},
  341. },
  342. },
  343. }
  344. // LabelRelationshipColumns holds the columns for the "label_relationship" table.
  345. LabelRelationshipColumns = []*schema.Column{
  346. {Name: "id", Type: field.TypeUint64, Increment: true},
  347. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  348. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  349. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  350. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  351. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  352. {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1},
  353. {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1},
  354. }
  355. // LabelRelationshipTable holds the schema information for the "label_relationship" table.
  356. LabelRelationshipTable = &schema.Table{
  357. Name: "label_relationship",
  358. Columns: LabelRelationshipColumns,
  359. PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]},
  360. ForeignKeys: []*schema.ForeignKey{
  361. {
  362. Symbol: "label_relationship_contact_contact_relationships",
  363. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  364. RefColumns: []*schema.Column{ContactColumns[0]},
  365. OnDelete: schema.NoAction,
  366. },
  367. {
  368. Symbol: "label_relationship_label_label_relationships",
  369. Columns: []*schema.Column{LabelRelationshipColumns[7]},
  370. RefColumns: []*schema.Column{LabelColumns[0]},
  371. OnDelete: schema.NoAction,
  372. },
  373. },
  374. Indexes: []*schema.Index{
  375. {
  376. Name: "labelrelationship_label_id",
  377. Unique: false,
  378. Columns: []*schema.Column{LabelRelationshipColumns[7]},
  379. },
  380. {
  381. Name: "labelrelationship_contact_id",
  382. Unique: false,
  383. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  384. },
  385. },
  386. }
  387. // LabelTaggingColumns holds the columns for the "label_tagging" table.
  388. LabelTaggingColumns = []*schema.Column{
  389. {Name: "id", Type: field.TypeUint64, Increment: true},
  390. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  391. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  392. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  393. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  394. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  395. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  396. {Name: "conditions", Type: field.TypeJSON, Nullable: true, Comment: "关键词"},
  397. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  398. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  399. }
  400. // LabelTaggingTable holds the schema information for the "label_tagging" table.
  401. LabelTaggingTable = &schema.Table{
  402. Name: "label_tagging",
  403. Columns: LabelTaggingColumns,
  404. PrimaryKey: []*schema.Column{LabelTaggingColumns[0]},
  405. }
  406. // MessagesColumns holds the columns for the "messages" table.
  407. MessagesColumns = []*schema.Column{
  408. {Name: "id", Type: field.TypeInt, Increment: true},
  409. {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
  410. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  411. {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""},
  412. }
  413. // MessagesTable holds the schema information for the "messages" table.
  414. MessagesTable = &schema.Table{
  415. Name: "messages",
  416. Columns: MessagesColumns,
  417. PrimaryKey: []*schema.Column{MessagesColumns[0]},
  418. }
  419. // MessageRecordsColumns holds the columns for the "message_records" table.
  420. MessageRecordsColumns = []*schema.Column{
  421. {Name: "id", Type: field.TypeUint64, Increment: true},
  422. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  423. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  424. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  425. {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
  426. {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
  427. {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
  428. {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
  429. {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
  430. {Name: "meta", Type: field.TypeJSON, Nullable: true, Comment: "元数据"},
  431. {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
  432. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  433. {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
  434. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  435. {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
  436. {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
  437. {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
  438. }
  439. // MessageRecordsTable holds the schema information for the "message_records" table.
  440. MessageRecordsTable = &schema.Table{
  441. Name: "message_records",
  442. Columns: MessageRecordsColumns,
  443. PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
  444. ForeignKeys: []*schema.ForeignKey{
  445. {
  446. Symbol: "message_records_contact_contact_messages",
  447. Columns: []*schema.Column{MessageRecordsColumns[14]},
  448. RefColumns: []*schema.Column{ContactColumns[0]},
  449. OnDelete: schema.SetNull,
  450. },
  451. {
  452. Symbol: "message_records_sop_node_node_messages",
  453. Columns: []*schema.Column{MessageRecordsColumns[15]},
  454. RefColumns: []*schema.Column{SopNodeColumns[0]},
  455. OnDelete: schema.SetNull,
  456. },
  457. {
  458. Symbol: "message_records_sop_stage_stage_messages",
  459. Columns: []*schema.Column{MessageRecordsColumns[16]},
  460. RefColumns: []*schema.Column{SopStageColumns[0]},
  461. OnDelete: schema.SetNull,
  462. },
  463. },
  464. Indexes: []*schema.Index{
  465. {
  466. Name: "messagerecords_source_type",
  467. Unique: false,
  468. Columns: []*schema.Column{MessageRecordsColumns[12]},
  469. },
  470. },
  471. }
  472. // MsgColumns holds the columns for the "msg" table.
  473. MsgColumns = []*schema.Column{
  474. {Name: "id", Type: field.TypeUint64, Increment: true},
  475. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  476. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  477. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  478. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用"},
  479. {Name: "fromwxid", Type: field.TypeString, Nullable: true, Comment: "发送方微信ID"},
  480. {Name: "toid", Type: field.TypeString, Nullable: true, Comment: "接收人微信ID/群ID"},
  481. {Name: "msgtype", Type: field.TypeInt32, Nullable: true, Comment: "消息类型"},
  482. {Name: "msg", Type: field.TypeString, Nullable: true, Comment: "消息"},
  483. {Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号"},
  484. }
  485. // MsgTable holds the schema information for the "msg" table.
  486. MsgTable = &schema.Table{
  487. Name: "msg",
  488. Columns: MsgColumns,
  489. PrimaryKey: []*schema.Column{MsgColumns[0]},
  490. Indexes: []*schema.Index{
  491. {
  492. Name: "msg_batch_no",
  493. Unique: false,
  494. Columns: []*schema.Column{MsgColumns[9]},
  495. },
  496. {
  497. Name: "msg_id",
  498. Unique: false,
  499. Columns: []*schema.Column{MsgColumns[0]},
  500. },
  501. {
  502. Name: "msg_status",
  503. Unique: false,
  504. Columns: []*schema.Column{MsgColumns[4]},
  505. },
  506. },
  507. }
  508. // ServerColumns holds the columns for the "server" table.
  509. ServerColumns = []*schema.Column{
  510. {Name: "id", Type: field.TypeUint64, Increment: true},
  511. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  512. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  513. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  514. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  515. {Name: "name", Type: field.TypeString, Comment: "名称"},
  516. {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
  517. {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
  518. {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
  519. }
  520. // ServerTable holds the schema information for the "server" table.
  521. ServerTable = &schema.Table{
  522. Name: "server",
  523. Columns: ServerColumns,
  524. PrimaryKey: []*schema.Column{ServerColumns[0]},
  525. Indexes: []*schema.Index{
  526. {
  527. Name: "server_name",
  528. Unique: false,
  529. Columns: []*schema.Column{ServerColumns[5]},
  530. },
  531. {
  532. Name: "server_private_ip",
  533. Unique: false,
  534. Columns: []*schema.Column{ServerColumns[7]},
  535. },
  536. {
  537. Name: "server_public_ip",
  538. Unique: true,
  539. Columns: []*schema.Column{ServerColumns[6]},
  540. },
  541. },
  542. }
  543. // SopNodeColumns holds the columns for the "sop_node" table.
  544. SopNodeColumns = []*schema.Column{
  545. {Name: "id", Type: field.TypeUint64, Increment: true},
  546. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  547. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  548. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  549. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  550. {Name: "parent_id", Type: field.TypeUint64, Comment: "父节点 ID"},
  551. {Name: "name", Type: field.TypeString, Comment: "节点名称", Default: ""},
  552. {Name: "condition_type", Type: field.TypeInt, Comment: "触发条件类型 1 客户回复后触发 2 超时后触发", Default: 1},
  553. {Name: "condition_list", Type: field.TypeJSON, Nullable: true, Comment: "触发语义列表 当为空时则代表用户回复任意内容后触发"},
  554. {Name: "no_reply_condition", Type: field.TypeUint64, Comment: "超时触发时间(分钟)", Default: 0},
  555. {Name: "no_reply_unit", Type: field.TypeString, Comment: "超时触发时间单位", Default: ""},
  556. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  557. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  558. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  559. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  560. {Name: "stage_id", Type: field.TypeUint64, Comment: "阶段 ID"},
  561. }
  562. // SopNodeTable holds the schema information for the "sop_node" table.
  563. SopNodeTable = &schema.Table{
  564. Name: "sop_node",
  565. Columns: SopNodeColumns,
  566. PrimaryKey: []*schema.Column{SopNodeColumns[0]},
  567. ForeignKeys: []*schema.ForeignKey{
  568. {
  569. Symbol: "sop_node_sop_stage_stage_nodes",
  570. Columns: []*schema.Column{SopNodeColumns[15]},
  571. RefColumns: []*schema.Column{SopStageColumns[0]},
  572. OnDelete: schema.NoAction,
  573. },
  574. },
  575. Indexes: []*schema.Index{
  576. {
  577. Name: "sopnode_name",
  578. Unique: false,
  579. Columns: []*schema.Column{SopNodeColumns[6]},
  580. },
  581. },
  582. }
  583. // SopStageColumns holds the columns for the "sop_stage" table.
  584. SopStageColumns = []*schema.Column{
  585. {Name: "id", Type: field.TypeUint64, Increment: true},
  586. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  587. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  588. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  589. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  590. {Name: "name", Type: field.TypeString, Comment: "阶段名称", Default: ""},
  591. {Name: "condition_type", Type: field.TypeInt, Comment: "客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选", Default: 1},
  592. {Name: "condition_operator", Type: field.TypeInt, Comment: "筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)", Default: 1},
  593. {Name: "condition_list", Type: field.TypeJSON, Comment: "筛选条件列表"},
  594. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  595. {Name: "action_label_add", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  596. {Name: "action_label_del", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要移除的标签"},
  597. {Name: "action_forward", Type: field.TypeJSON, Nullable: true, Comment: "命中后转发的消息"},
  598. {Name: "index_sort", Type: field.TypeInt, Nullable: true, Comment: "阶段顺序", Default: 1},
  599. {Name: "task_id", Type: field.TypeUint64, Comment: "SOP 任务 ID"},
  600. }
  601. // SopStageTable holds the schema information for the "sop_stage" table.
  602. SopStageTable = &schema.Table{
  603. Name: "sop_stage",
  604. Columns: SopStageColumns,
  605. PrimaryKey: []*schema.Column{SopStageColumns[0]},
  606. ForeignKeys: []*schema.ForeignKey{
  607. {
  608. Symbol: "sop_stage_sop_task_task_stages",
  609. Columns: []*schema.Column{SopStageColumns[14]},
  610. RefColumns: []*schema.Column{SopTaskColumns[0]},
  611. OnDelete: schema.NoAction,
  612. },
  613. },
  614. Indexes: []*schema.Index{
  615. {
  616. Name: "sopstage_name",
  617. Unique: false,
  618. Columns: []*schema.Column{SopStageColumns[5]},
  619. },
  620. },
  621. }
  622. // SopTaskColumns holds the columns for the "sop_task" table.
  623. SopTaskColumns = []*schema.Column{
  624. {Name: "id", Type: field.TypeUint64, Increment: true},
  625. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  626. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  627. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  628. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  629. {Name: "name", Type: field.TypeString, Comment: "SOP 任务名称"},
  630. {Name: "bot_wxid_list", Type: field.TypeJSON, Nullable: true, Comment: "机器人微信 id 列表"},
  631. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3企业微信联系人", Default: 1},
  632. {Name: "plan_start_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划开始时间"},
  633. {Name: "plan_end_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划结束时间"},
  634. {Name: "creator_id", Type: field.TypeString, Nullable: true, Comment: "创建者 id"},
  635. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  636. {Name: "token", Type: field.TypeJSON, Nullable: true, Comment: "Token"},
  637. }
  638. // SopTaskTable holds the schema information for the "sop_task" table.
  639. SopTaskTable = &schema.Table{
  640. Name: "sop_task",
  641. Columns: SopTaskColumns,
  642. PrimaryKey: []*schema.Column{SopTaskColumns[0]},
  643. Indexes: []*schema.Index{
  644. {
  645. Name: "soptask_name",
  646. Unique: false,
  647. Columns: []*schema.Column{SopTaskColumns[5]},
  648. },
  649. {
  650. Name: "soptask_token",
  651. Unique: false,
  652. Columns: []*schema.Column{SopTaskColumns[12]},
  653. },
  654. },
  655. }
  656. // TokenColumns holds the columns for the "token" table.
  657. TokenColumns = []*schema.Column{
  658. {Name: "id", Type: field.TypeUint64, Increment: true},
  659. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  660. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  661. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  662. {Name: "expire_at", Type: field.TypeTime, Nullable: true, Comment: "过期时间"},
  663. {Name: "token", Type: field.TypeString, Nullable: true, Comment: "Token", Default: ""},
  664. {Name: "mac", Type: field.TypeString, Nullable: true, Comment: "Mac地址", Default: ""},
  665. {Name: "organization_id", Type: field.TypeUint64, Comment: "租户ID", Default: 0},
  666. {Name: "custom_agent_base", Type: field.TypeString, Nullable: true, Comment: "定制agent服务地址", Default: ""},
  667. {Name: "custom_agent_key", Type: field.TypeString, Nullable: true, Comment: "定制agent服务密钥", Default: ""},
  668. {Name: "openai_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  669. {Name: "openai_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  670. {Name: "agent_id", Type: field.TypeUint64, Comment: "智能体ID", Default: 0},
  671. }
  672. // TokenTable holds the schema information for the "token" table.
  673. TokenTable = &schema.Table{
  674. Name: "token",
  675. Columns: TokenColumns,
  676. PrimaryKey: []*schema.Column{TokenColumns[0]},
  677. ForeignKeys: []*schema.ForeignKey{
  678. {
  679. Symbol: "token_agent_token_agent",
  680. Columns: []*schema.Column{TokenColumns[12]},
  681. RefColumns: []*schema.Column{AgentColumns[0]},
  682. OnDelete: schema.NoAction,
  683. },
  684. },
  685. Indexes: []*schema.Index{
  686. {
  687. Name: "token_token",
  688. Unique: true,
  689. Columns: []*schema.Column{TokenColumns[5]},
  690. },
  691. },
  692. }
  693. // TutorialColumns holds the columns for the "tutorial" table.
  694. TutorialColumns = []*schema.Column{
  695. {Name: "id", Type: field.TypeUint64, Increment: true},
  696. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  697. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  698. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  699. {Name: "index", Type: field.TypeInt, Comment: "index | 序号"},
  700. {Name: "title", Type: field.TypeString, Comment: "title | 标题"},
  701. {Name: "content", Type: field.TypeString, Comment: "content | 内容"},
  702. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  703. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  704. }
  705. // TutorialTable holds the schema information for the "tutorial" table.
  706. TutorialTable = &schema.Table{
  707. Name: "tutorial",
  708. Columns: TutorialColumns,
  709. PrimaryKey: []*schema.Column{TutorialColumns[0]},
  710. ForeignKeys: []*schema.ForeignKey{
  711. {
  712. Symbol: "tutorial_employee_em_tutorial",
  713. Columns: []*schema.Column{TutorialColumns[8]},
  714. RefColumns: []*schema.Column{EmployeeColumns[0]},
  715. OnDelete: schema.NoAction,
  716. },
  717. },
  718. Indexes: []*schema.Index{
  719. {
  720. Name: "tutorial_employee_id",
  721. Unique: false,
  722. Columns: []*schema.Column{TutorialColumns[8]},
  723. },
  724. },
  725. }
  726. // UsageDetailColumns holds the columns for the "usage_detail" table.
  727. UsageDetailColumns = []*schema.Column{
  728. {Name: "id", Type: field.TypeUint64, Increment: true},
  729. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  730. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  731. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  732. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  733. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  734. {Name: "receiver_id", Type: field.TypeString, Comment: "微信id或open_id", Default: ""},
  735. {Name: "app", Type: field.TypeInt, Nullable: true, Comment: "1 cow-basic 2 cow-agent 3 cow-sop 4 mp-card 5 mp-employee", Default: 1},
  736. {Name: "session_id", Type: field.TypeUint64, Nullable: true, Comment: "名片会话id", Default: 1},
  737. {Name: "request", Type: field.TypeString, Comment: "请求内容", Default: ""},
  738. {Name: "response", Type: field.TypeString, Comment: "响应内容", Default: ""},
  739. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  740. {Name: "prompt_tokens", Type: field.TypeUint64, Nullable: true, Comment: "请求token数", Default: 0},
  741. {Name: "completion_tokens", Type: field.TypeUint64, Nullable: true, Comment: "响应token数", Default: 0},
  742. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  743. }
  744. // UsageDetailTable holds the schema information for the "usage_detail" table.
  745. UsageDetailTable = &schema.Table{
  746. Name: "usage_detail",
  747. Columns: UsageDetailColumns,
  748. PrimaryKey: []*schema.Column{UsageDetailColumns[0]},
  749. Indexes: []*schema.Index{
  750. {
  751. Name: "usagedetail_bot_id",
  752. Unique: false,
  753. Columns: []*schema.Column{UsageDetailColumns[5]},
  754. },
  755. {
  756. Name: "usagedetail_organization_id",
  757. Unique: false,
  758. Columns: []*schema.Column{UsageDetailColumns[14]},
  759. },
  760. },
  761. }
  762. // UsageTotalColumns holds the columns for the "usage_total" table.
  763. UsageTotalColumns = []*schema.Column{
  764. {Name: "id", Type: field.TypeUint64, Increment: true},
  765. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  766. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  767. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  768. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "1 微信 2 名片", Default: 1},
  769. {Name: "bot_id", Type: field.TypeString, Comment: "微信或名片id", Default: ""},
  770. {Name: "total_tokens", Type: field.TypeUint64, Nullable: true, Comment: "使用token总数", Default: 0},
  771. {Name: "start_index", Type: field.TypeUint64, Nullable: true, Comment: "重制后的起始usage_detail 索引", Default: 0},
  772. {Name: "end_index", Type: field.TypeUint64, Nullable: true, Comment: "usage_detail 索引", Default: 0},
  773. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  774. }
  775. // UsageTotalTable holds the schema information for the "usage_total" table.
  776. UsageTotalTable = &schema.Table{
  777. Name: "usage_total",
  778. Columns: UsageTotalColumns,
  779. PrimaryKey: []*schema.Column{UsageTotalColumns[0]},
  780. Indexes: []*schema.Index{
  781. {
  782. Name: "usagetotal_bot_id",
  783. Unique: false,
  784. Columns: []*schema.Column{UsageTotalColumns[5]},
  785. },
  786. {
  787. Name: "usagetotal_organization_id",
  788. Unique: false,
  789. Columns: []*schema.Column{UsageTotalColumns[9]},
  790. },
  791. },
  792. }
  793. // WorkExperienceColumns holds the columns for the "work_experience" table.
  794. WorkExperienceColumns = []*schema.Column{
  795. {Name: "id", Type: field.TypeUint64, Increment: true},
  796. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  797. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  798. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  799. {Name: "start_date", Type: field.TypeTime, Comment: "start_date | 开始时间"},
  800. {Name: "end_date", Type: field.TypeTime, Comment: "end_date | 结束时间"},
  801. {Name: "company", Type: field.TypeString, Comment: "company | 公司名"},
  802. {Name: "experience", Type: field.TypeString, Size: 2147483647, Comment: "experience | 工作内容"},
  803. {Name: "organization_id", Type: field.TypeUint64, Comment: "organization_id | 租户ID"},
  804. {Name: "employee_id", Type: field.TypeUint64, Comment: "employee_id | 员工ID"},
  805. }
  806. // WorkExperienceTable holds the schema information for the "work_experience" table.
  807. WorkExperienceTable = &schema.Table{
  808. Name: "work_experience",
  809. Columns: WorkExperienceColumns,
  810. PrimaryKey: []*schema.Column{WorkExperienceColumns[0]},
  811. ForeignKeys: []*schema.ForeignKey{
  812. {
  813. Symbol: "work_experience_employee_em_work_experiences",
  814. Columns: []*schema.Column{WorkExperienceColumns[9]},
  815. RefColumns: []*schema.Column{EmployeeColumns[0]},
  816. OnDelete: schema.NoAction,
  817. },
  818. },
  819. Indexes: []*schema.Index{
  820. {
  821. Name: "workexperience_employee_id",
  822. Unique: false,
  823. Columns: []*schema.Column{WorkExperienceColumns[9]},
  824. },
  825. },
  826. }
  827. // WpChatroomColumns holds the columns for the "wp_chatroom" table.
  828. WpChatroomColumns = []*schema.Column{
  829. {Name: "id", Type: field.TypeUint64, Increment: true},
  830. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  831. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  832. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  833. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  834. {Name: "chatroom_id", Type: field.TypeString, Comment: "群id", Default: ""},
  835. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  836. {Name: "owner", Type: field.TypeString, Comment: "群主", Default: ""},
  837. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  838. {Name: "member_list", Type: field.TypeJSON, Comment: "群成员"},
  839. }
  840. // WpChatroomTable holds the schema information for the "wp_chatroom" table.
  841. WpChatroomTable = &schema.Table{
  842. Name: "wp_chatroom",
  843. Columns: WpChatroomColumns,
  844. PrimaryKey: []*schema.Column{WpChatroomColumns[0]},
  845. Indexes: []*schema.Index{
  846. {
  847. Name: "wpchatroom_wx_wxid_chatroom_id",
  848. Unique: false,
  849. Columns: []*schema.Column{WpChatroomColumns[4], WpChatroomColumns[5]},
  850. },
  851. },
  852. }
  853. // WpChatroomMemberColumns holds the columns for the "wp_chatroom_member" table.
  854. WpChatroomMemberColumns = []*schema.Column{
  855. {Name: "id", Type: field.TypeUint64, Increment: true},
  856. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  857. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  858. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  859. {Name: "wx_wxid", Type: field.TypeString, Comment: "所属微信id", Default: ""},
  860. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  861. {Name: "nickname", Type: field.TypeString, Comment: "群昵称", Default: ""},
  862. {Name: "avatar", Type: field.TypeString, Comment: "群头像", Default: ""},
  863. }
  864. // WpChatroomMemberTable holds the schema information for the "wp_chatroom_member" table.
  865. WpChatroomMemberTable = &schema.Table{
  866. Name: "wp_chatroom_member",
  867. Columns: WpChatroomMemberColumns,
  868. PrimaryKey: []*schema.Column{WpChatroomMemberColumns[0]},
  869. Indexes: []*schema.Index{
  870. {
  871. Name: "wpchatroommember_wx_wxid_wxid",
  872. Unique: false,
  873. Columns: []*schema.Column{WpChatroomMemberColumns[4], WpChatroomMemberColumns[5]},
  874. },
  875. },
  876. }
  877. // WxColumns holds the columns for the "wx" table.
  878. WxColumns = []*schema.Column{
  879. {Name: "id", Type: field.TypeUint64, Increment: true},
  880. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  881. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  882. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  883. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  884. {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
  885. {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
  886. {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
  887. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  888. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  889. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
  890. {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
  891. {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
  892. {Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
  893. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "大模型服务地址", Default: ""},
  894. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "大模型服务密钥", Default: ""},
  895. {Name: "allow_list", Type: field.TypeJSON, Comment: "白名单"},
  896. {Name: "group_allow_list", Type: field.TypeJSON, Comment: "群白名单"},
  897. {Name: "block_list", Type: field.TypeJSON, Comment: "黑名单"},
  898. {Name: "group_block_list", Type: field.TypeJSON, Comment: "群黑名单"},
  899. {Name: "agent_id", Type: field.TypeUint64, Comment: "模式ID", Default: 0},
  900. {Name: "agent_base_wx_agent", Type: field.TypeString, Nullable: true},
  901. {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
  902. }
  903. // WxTable holds the schema information for the "wx" table.
  904. WxTable = &schema.Table{
  905. Name: "wx",
  906. Columns: WxColumns,
  907. PrimaryKey: []*schema.Column{WxColumns[0]},
  908. ForeignKeys: []*schema.ForeignKey{
  909. {
  910. Symbol: "wx_agent_wx_agent",
  911. Columns: []*schema.Column{WxColumns[20]},
  912. RefColumns: []*schema.Column{AgentColumns[0]},
  913. OnDelete: schema.NoAction,
  914. },
  915. {
  916. Symbol: "wx_agent_base_wx_agent",
  917. Columns: []*schema.Column{WxColumns[21]},
  918. RefColumns: []*schema.Column{AgentBaseColumns[0]},
  919. OnDelete: schema.SetNull,
  920. },
  921. {
  922. Symbol: "wx_server_wxs",
  923. Columns: []*schema.Column{WxColumns[22]},
  924. RefColumns: []*schema.Column{ServerColumns[0]},
  925. OnDelete: schema.SetNull,
  926. },
  927. },
  928. Indexes: []*schema.Index{
  929. {
  930. Name: "wx_server_id_port",
  931. Unique: true,
  932. Columns: []*schema.Column{WxColumns[22], WxColumns[5]},
  933. },
  934. {
  935. Name: "wx_wxid",
  936. Unique: true,
  937. Columns: []*schema.Column{WxColumns[8]},
  938. },
  939. {
  940. Name: "wx_account",
  941. Unique: false,
  942. Columns: []*schema.Column{WxColumns[9]},
  943. },
  944. {
  945. Name: "wx_nickname",
  946. Unique: false,
  947. Columns: []*schema.Column{WxColumns[10]},
  948. },
  949. {
  950. Name: "wx_tel",
  951. Unique: false,
  952. Columns: []*schema.Column{WxColumns[11]},
  953. },
  954. },
  955. }
  956. // WxCardColumns holds the columns for the "wx_card" table.
  957. WxCardColumns = []*schema.Column{
  958. {Name: "id", Type: field.TypeUint64, Increment: true},
  959. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  960. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  961. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  962. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  963. {Name: "wx_user_id", Type: field.TypeUint64, Nullable: true, Comment: "wx表ID", Default: 0},
  964. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  965. {Name: "logo", Type: field.TypeString, Comment: "logo", Default: ""},
  966. {Name: "name", Type: field.TypeString, Comment: "名称", Default: ""},
  967. {Name: "company", Type: field.TypeString, Comment: "公司", Default: ""},
  968. {Name: "address", Type: field.TypeString, Comment: "地址", Default: ""},
  969. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  970. {Name: "official_account", Type: field.TypeString, Comment: "公众号", Default: ""},
  971. {Name: "wechat_account", Type: field.TypeString, Comment: "微信号", Default: ""},
  972. {Name: "email", Type: field.TypeString, Nullable: true, Comment: "邮箱", Default: ""},
  973. {Name: "api_base", Type: field.TypeString, Nullable: true, Comment: "fastgpt-base"},
  974. {Name: "api_key", Type: field.TypeString, Nullable: true, Comment: "fastgpt-key"},
  975. {Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
  976. {Name: "intro", Type: field.TypeString, Nullable: true, Comment: "个人介绍", Default: ""},
  977. }
  978. // WxCardTable holds the schema information for the "wx_card" table.
  979. WxCardTable = &schema.Table{
  980. Name: "wx_card",
  981. Columns: WxCardColumns,
  982. PrimaryKey: []*schema.Column{WxCardColumns[0]},
  983. Indexes: []*schema.Index{
  984. {
  985. Name: "wxcard_user_id",
  986. Unique: false,
  987. Columns: []*schema.Column{WxCardColumns[4]},
  988. },
  989. {
  990. Name: "wxcard_wx_user_id",
  991. Unique: false,
  992. Columns: []*schema.Column{WxCardColumns[5]},
  993. },
  994. },
  995. }
  996. // WxCardUserColumns holds the columns for the "wx_card_user" table.
  997. WxCardUserColumns = []*schema.Column{
  998. {Name: "id", Type: field.TypeUint64, Increment: true},
  999. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1000. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1001. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1002. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  1003. {Name: "account", Type: field.TypeString, Comment: "微信号", Default: ""},
  1004. {Name: "avatar", Type: field.TypeString, Comment: "头像", Default: ""},
  1005. {Name: "nickname", Type: field.TypeString, Comment: "昵称", Default: ""},
  1006. {Name: "remark", Type: field.TypeString, Comment: "备注名", Default: ""},
  1007. {Name: "phone", Type: field.TypeString, Comment: "手机号", Default: ""},
  1008. {Name: "open_id", Type: field.TypeString, Comment: "OpenID", Default: ""},
  1009. {Name: "union_id", Type: field.TypeString, Comment: "UnionID", Default: ""},
  1010. {Name: "session_key", Type: field.TypeString, Comment: "SessionKey", Default: ""},
  1011. {Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
  1012. }
  1013. // WxCardUserTable holds the schema information for the "wx_card_user" table.
  1014. WxCardUserTable = &schema.Table{
  1015. Name: "wx_card_user",
  1016. Columns: WxCardUserColumns,
  1017. PrimaryKey: []*schema.Column{WxCardUserColumns[0]},
  1018. Indexes: []*schema.Index{
  1019. {
  1020. Name: "wxcarduser_wxid_open_id",
  1021. Unique: false,
  1022. Columns: []*schema.Column{WxCardUserColumns[4], WxCardUserColumns[10]},
  1023. },
  1024. },
  1025. }
  1026. // WxCardVisitColumns holds the columns for the "wx_card_visit" table.
  1027. WxCardVisitColumns = []*schema.Column{
  1028. {Name: "id", Type: field.TypeUint64, Increment: true},
  1029. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  1030. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  1031. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  1032. {Name: "user_id", Type: field.TypeUint64, Nullable: true, Comment: "user表ID", Default: 0},
  1033. {Name: "bot_id", Type: field.TypeUint64, Comment: "被访ID", Default: 0},
  1034. {Name: "bot_type", Type: field.TypeUint8, Comment: "类型:1-微信 2-小程序 3-智能体", Default: 0},
  1035. }
  1036. // WxCardVisitTable holds the schema information for the "wx_card_visit" table.
  1037. WxCardVisitTable = &schema.Table{
  1038. Name: "wx_card_visit",
  1039. Columns: WxCardVisitColumns,
  1040. PrimaryKey: []*schema.Column{WxCardVisitColumns[0]},
  1041. Indexes: []*schema.Index{
  1042. {
  1043. Name: "wxcardvisit_user_id",
  1044. Unique: false,
  1045. Columns: []*schema.Column{WxCardVisitColumns[4]},
  1046. },
  1047. {
  1048. Name: "wxcardvisit_bot_id_bot_type",
  1049. Unique: false,
  1050. Columns: []*schema.Column{WxCardVisitColumns[5], WxCardVisitColumns[6]},
  1051. },
  1052. },
  1053. }
  1054. // Tables holds all the tables in the schema.
  1055. Tables = []*schema.Table{
  1056. AgentTable,
  1057. AgentBaseTable,
  1058. AliyunAvatarTable,
  1059. BatchMsgTable,
  1060. CategoryTable,
  1061. ChatRecordsTable,
  1062. ChatSessionTable,
  1063. ContactTable,
  1064. EmployeeTable,
  1065. EmployeeConfigTable,
  1066. LabelTable,
  1067. LabelRelationshipTable,
  1068. LabelTaggingTable,
  1069. MessagesTable,
  1070. MessageRecordsTable,
  1071. MsgTable,
  1072. ServerTable,
  1073. SopNodeTable,
  1074. SopStageTable,
  1075. SopTaskTable,
  1076. TokenTable,
  1077. TutorialTable,
  1078. UsageDetailTable,
  1079. UsageTotalTable,
  1080. WorkExperienceTable,
  1081. WpChatroomTable,
  1082. WpChatroomMemberTable,
  1083. WxTable,
  1084. WxCardTable,
  1085. WxCardUserTable,
  1086. WxCardVisitTable,
  1087. }
  1088. )
  1089. func init() {
  1090. AgentTable.Annotation = &entsql.Annotation{
  1091. Table: "agent",
  1092. }
  1093. AgentBaseTable.Annotation = &entsql.Annotation{
  1094. Table: "agent_base",
  1095. }
  1096. AliyunAvatarTable.Annotation = &entsql.Annotation{
  1097. Table: "aliyun_avatar",
  1098. }
  1099. BatchMsgTable.Annotation = &entsql.Annotation{
  1100. Table: "batch_msg",
  1101. }
  1102. CategoryTable.Annotation = &entsql.Annotation{
  1103. Table: "category",
  1104. }
  1105. ChatRecordsTable.Annotation = &entsql.Annotation{
  1106. Table: "chat_records",
  1107. }
  1108. ChatSessionTable.Annotation = &entsql.Annotation{
  1109. Table: "chat_session",
  1110. }
  1111. ContactTable.Annotation = &entsql.Annotation{
  1112. Table: "contact",
  1113. }
  1114. EmployeeTable.Annotation = &entsql.Annotation{
  1115. Table: "employee",
  1116. }
  1117. EmployeeConfigTable.Annotation = &entsql.Annotation{
  1118. Table: "employee_config",
  1119. }
  1120. LabelTable.Annotation = &entsql.Annotation{
  1121. Table: "label",
  1122. }
  1123. LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable
  1124. LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable
  1125. LabelRelationshipTable.Annotation = &entsql.Annotation{
  1126. Table: "label_relationship",
  1127. }
  1128. LabelTaggingTable.Annotation = &entsql.Annotation{
  1129. Table: "label_tagging",
  1130. }
  1131. MessagesTable.Annotation = &entsql.Annotation{
  1132. Table: "messages",
  1133. }
  1134. MessageRecordsTable.ForeignKeys[0].RefTable = ContactTable
  1135. MessageRecordsTable.ForeignKeys[1].RefTable = SopNodeTable
  1136. MessageRecordsTable.ForeignKeys[2].RefTable = SopStageTable
  1137. MessageRecordsTable.Annotation = &entsql.Annotation{
  1138. Table: "message_records",
  1139. }
  1140. MsgTable.Annotation = &entsql.Annotation{
  1141. Table: "msg",
  1142. }
  1143. ServerTable.Annotation = &entsql.Annotation{
  1144. Table: "server",
  1145. }
  1146. SopNodeTable.ForeignKeys[0].RefTable = SopStageTable
  1147. SopNodeTable.Annotation = &entsql.Annotation{
  1148. Table: "sop_node",
  1149. }
  1150. SopStageTable.ForeignKeys[0].RefTable = SopTaskTable
  1151. SopStageTable.Annotation = &entsql.Annotation{
  1152. Table: "sop_stage",
  1153. }
  1154. SopTaskTable.Annotation = &entsql.Annotation{
  1155. Table: "sop_task",
  1156. }
  1157. TokenTable.ForeignKeys[0].RefTable = AgentTable
  1158. TokenTable.Annotation = &entsql.Annotation{
  1159. Table: "token",
  1160. }
  1161. TutorialTable.ForeignKeys[0].RefTable = EmployeeTable
  1162. TutorialTable.Annotation = &entsql.Annotation{
  1163. Table: "tutorial",
  1164. }
  1165. UsageDetailTable.Annotation = &entsql.Annotation{
  1166. Table: "usage_detail",
  1167. }
  1168. UsageTotalTable.Annotation = &entsql.Annotation{
  1169. Table: "usage_total",
  1170. }
  1171. WorkExperienceTable.ForeignKeys[0].RefTable = EmployeeTable
  1172. WorkExperienceTable.Annotation = &entsql.Annotation{
  1173. Table: "work_experience",
  1174. }
  1175. WpChatroomTable.Annotation = &entsql.Annotation{
  1176. Table: "wp_chatroom",
  1177. }
  1178. WpChatroomMemberTable.Annotation = &entsql.Annotation{
  1179. Table: "wp_chatroom_member",
  1180. }
  1181. WxTable.ForeignKeys[0].RefTable = AgentTable
  1182. WxTable.ForeignKeys[1].RefTable = AgentBaseTable
  1183. WxTable.ForeignKeys[2].RefTable = ServerTable
  1184. WxTable.Annotation = &entsql.Annotation{
  1185. Table: "wx",
  1186. }
  1187. WxCardTable.Annotation = &entsql.Annotation{
  1188. Table: "wx_card",
  1189. }
  1190. WxCardUserTable.Annotation = &entsql.Annotation{
  1191. Table: "wx_card_user",
  1192. }
  1193. WxCardVisitTable.Annotation = &entsql.Annotation{
  1194. Table: "wx_card_visit",
  1195. }
  1196. }