schema.go 46 KB

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