schema.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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. // ContactColumns holds the columns for the "contact" table.
  10. ContactColumns = []*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: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  15. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  16. {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
  17. {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "联系人类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  18. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  19. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  20. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称 群备注名称", Default: ""},
  21. {Name: "markname", Type: field.TypeString, Comment: "备注名", Default: ""},
  22. {Name: "headimg", Type: field.TypeString, Comment: "头像", Default: ""},
  23. {Name: "sex", Type: field.TypeInt, Comment: "性别 0未知 1男 2女", Default: 0},
  24. {Name: "starrole", Type: field.TypeString, Comment: "星标 65/67=星标 1/3=未星标", Default: ""},
  25. {Name: "dontseeit", Type: field.TypeInt, Comment: "不让他看我的朋友圈 0可以看 1不让看", Default: 0},
  26. {Name: "dontseeme", Type: field.TypeInt, Comment: "不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天", Default: 0},
  27. {Name: "lag", Type: field.TypeString, Comment: "所属标签id清单,多开会用逗号隔开", Default: ""},
  28. {Name: "gid", Type: field.TypeString, Comment: "群组id", Default: ""},
  29. {Name: "gname", Type: field.TypeString, Comment: "群组名称", Default: ""},
  30. {Name: "v3", Type: field.TypeString, Comment: "v3数据", Default: ""},
  31. }
  32. // ContactTable holds the schema information for the "contact" table.
  33. ContactTable = &schema.Table{
  34. Name: "contact",
  35. Columns: ContactColumns,
  36. PrimaryKey: []*schema.Column{ContactColumns[0]},
  37. Indexes: []*schema.Index{
  38. {
  39. Name: "contact_wx_wxid_wxid",
  40. Unique: true,
  41. Columns: []*schema.Column{ContactColumns[5], ContactColumns[7]},
  42. },
  43. {
  44. Name: "contact_wxid",
  45. Unique: false,
  46. Columns: []*schema.Column{ContactColumns[7]},
  47. },
  48. {
  49. Name: "contact_type",
  50. Unique: false,
  51. Columns: []*schema.Column{ContactColumns[6]},
  52. },
  53. {
  54. Name: "contact_gid",
  55. Unique: false,
  56. Columns: []*schema.Column{ContactColumns[17]},
  57. },
  58. },
  59. }
  60. // LabelColumns holds the columns for the "label" table.
  61. LabelColumns = []*schema.Column{
  62. {Name: "id", Type: field.TypeUint64, Increment: true},
  63. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  64. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  65. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  66. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  67. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1},
  68. {Name: "name", Type: field.TypeString, Comment: "标签名称", Default: ""},
  69. {Name: "from", Type: field.TypeInt, Comment: "标签来源:1后台创建 2个微同步", Default: 1},
  70. {Name: "mode", Type: field.TypeInt, Comment: "标签模式:1动态 2静态", Default: 1},
  71. {Name: "conditions", Type: field.TypeString, Nullable: true, Comment: "标签的触达条件", Default: ""},
  72. }
  73. // LabelTable holds the schema information for the "label" table.
  74. LabelTable = &schema.Table{
  75. Name: "label",
  76. Columns: LabelColumns,
  77. PrimaryKey: []*schema.Column{LabelColumns[0]},
  78. Indexes: []*schema.Index{
  79. {
  80. Name: "label_name_from_mode",
  81. Unique: true,
  82. Columns: []*schema.Column{LabelColumns[6], LabelColumns[7], LabelColumns[8]},
  83. },
  84. },
  85. }
  86. // LabelRelationshipColumns holds the columns for the "label_relationship" table.
  87. LabelRelationshipColumns = []*schema.Column{
  88. {Name: "id", Type: field.TypeUint64, Increment: true},
  89. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  90. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  91. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  92. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  93. {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1},
  94. {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1},
  95. }
  96. // LabelRelationshipTable holds the schema information for the "label_relationship" table.
  97. LabelRelationshipTable = &schema.Table{
  98. Name: "label_relationship",
  99. Columns: LabelRelationshipColumns,
  100. PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]},
  101. ForeignKeys: []*schema.ForeignKey{
  102. {
  103. Symbol: "label_relationship_contact_contact_relationships",
  104. Columns: []*schema.Column{LabelRelationshipColumns[5]},
  105. RefColumns: []*schema.Column{ContactColumns[0]},
  106. OnDelete: schema.NoAction,
  107. },
  108. {
  109. Symbol: "label_relationship_label_label_relationships",
  110. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  111. RefColumns: []*schema.Column{LabelColumns[0]},
  112. OnDelete: schema.NoAction,
  113. },
  114. },
  115. Indexes: []*schema.Index{
  116. {
  117. Name: "labelrelationship_label_id",
  118. Unique: false,
  119. Columns: []*schema.Column{LabelRelationshipColumns[6]},
  120. },
  121. {
  122. Name: "labelrelationship_contact_id",
  123. Unique: false,
  124. Columns: []*schema.Column{LabelRelationshipColumns[5]},
  125. },
  126. },
  127. }
  128. // MessageColumns holds the columns for the "message" table.
  129. MessageColumns = []*schema.Column{
  130. {Name: "id", Type: field.TypeInt, Increment: true},
  131. {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""},
  132. {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""},
  133. {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""},
  134. }
  135. // MessageTable holds the schema information for the "message" table.
  136. MessageTable = &schema.Table{
  137. Name: "message",
  138. Columns: MessageColumns,
  139. PrimaryKey: []*schema.Column{MessageColumns[0]},
  140. }
  141. // MessageRecordsColumns holds the columns for the "message_records" table.
  142. MessageRecordsColumns = []*schema.Column{
  143. {Name: "id", Type: field.TypeUint64, Increment: true},
  144. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  145. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  146. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  147. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  148. {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
  149. {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
  150. {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
  151. {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
  152. {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
  153. {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
  154. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  155. {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
  156. {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
  157. {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
  158. {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
  159. }
  160. // MessageRecordsTable holds the schema information for the "message_records" table.
  161. MessageRecordsTable = &schema.Table{
  162. Name: "message_records",
  163. Columns: MessageRecordsColumns,
  164. PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
  165. ForeignKeys: []*schema.ForeignKey{
  166. {
  167. Symbol: "message_records_contact_contact_messages",
  168. Columns: []*schema.Column{MessageRecordsColumns[13]},
  169. RefColumns: []*schema.Column{ContactColumns[0]},
  170. OnDelete: schema.SetNull,
  171. },
  172. {
  173. Symbol: "message_records_sop_node_node_messages",
  174. Columns: []*schema.Column{MessageRecordsColumns[14]},
  175. RefColumns: []*schema.Column{SopNodeColumns[0]},
  176. OnDelete: schema.SetNull,
  177. },
  178. {
  179. Symbol: "message_records_sop_stage_stage_messages",
  180. Columns: []*schema.Column{MessageRecordsColumns[15]},
  181. RefColumns: []*schema.Column{SopStageColumns[0]},
  182. OnDelete: schema.SetNull,
  183. },
  184. },
  185. Indexes: []*schema.Index{
  186. {
  187. Name: "messagerecords_source_type",
  188. Unique: false,
  189. Columns: []*schema.Column{MessageRecordsColumns[12]},
  190. },
  191. },
  192. }
  193. // ServerColumns holds the columns for the "server" table.
  194. ServerColumns = []*schema.Column{
  195. {Name: "id", Type: field.TypeUint64, Increment: true},
  196. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  197. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  198. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  199. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  200. {Name: "name", Type: field.TypeString, Comment: "名称"},
  201. {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
  202. {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
  203. {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
  204. }
  205. // ServerTable holds the schema information for the "server" table.
  206. ServerTable = &schema.Table{
  207. Name: "server",
  208. Columns: ServerColumns,
  209. PrimaryKey: []*schema.Column{ServerColumns[0]},
  210. Indexes: []*schema.Index{
  211. {
  212. Name: "server_name",
  213. Unique: false,
  214. Columns: []*schema.Column{ServerColumns[5]},
  215. },
  216. {
  217. Name: "server_private_ip",
  218. Unique: false,
  219. Columns: []*schema.Column{ServerColumns[7]},
  220. },
  221. {
  222. Name: "server_public_ip",
  223. Unique: true,
  224. Columns: []*schema.Column{ServerColumns[6]},
  225. },
  226. },
  227. }
  228. // SopNodeColumns holds the columns for the "sop_node" table.
  229. SopNodeColumns = []*schema.Column{
  230. {Name: "id", Type: field.TypeUint64, Increment: true},
  231. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  232. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  233. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  234. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  235. {Name: "parent_id", Type: field.TypeUint64, Comment: "父节点 ID"},
  236. {Name: "name", Type: field.TypeString, Comment: "节点名称", Default: ""},
  237. {Name: "condition_type", Type: field.TypeInt, Comment: "触发条件类型 1 客户回复后触发 2 超时后触发", Default: 1},
  238. {Name: "condition_list", Type: field.TypeJSON, Nullable: true, Comment: "触发语义列表 当为空时则代表用户回复任意内容后触发"},
  239. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  240. {Name: "action_label", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  241. {Name: "stage_id", Type: field.TypeUint64, Comment: "阶段 ID"},
  242. }
  243. // SopNodeTable holds the schema information for the "sop_node" table.
  244. SopNodeTable = &schema.Table{
  245. Name: "sop_node",
  246. Columns: SopNodeColumns,
  247. PrimaryKey: []*schema.Column{SopNodeColumns[0]},
  248. ForeignKeys: []*schema.ForeignKey{
  249. {
  250. Symbol: "sop_node_sop_stage_stage_nodes",
  251. Columns: []*schema.Column{SopNodeColumns[11]},
  252. RefColumns: []*schema.Column{SopStageColumns[0]},
  253. OnDelete: schema.NoAction,
  254. },
  255. },
  256. Indexes: []*schema.Index{
  257. {
  258. Name: "sopnode_name",
  259. Unique: false,
  260. Columns: []*schema.Column{SopNodeColumns[6]},
  261. },
  262. },
  263. }
  264. // SopStageColumns holds the columns for the "sop_stage" table.
  265. SopStageColumns = []*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: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  270. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  271. {Name: "name", Type: field.TypeString, Comment: "阶段名称", Default: ""},
  272. {Name: "condition_type", Type: field.TypeInt, Comment: "客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选", Default: 1},
  273. {Name: "condition_operator", Type: field.TypeInt, Comment: "筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)", Default: 1},
  274. {Name: "condition_list", Type: field.TypeJSON, Comment: "筛选条件列表"},
  275. {Name: "action_message", Type: field.TypeJSON, Nullable: true, Comment: "命中后发送的消息内容"},
  276. {Name: "action_label", Type: field.TypeJSON, Nullable: true, Comment: "命中后需要打的标签"},
  277. {Name: "index_sort", Type: field.TypeInt, Nullable: true, Comment: "阶段顺序", Default: 1},
  278. {Name: "task_id", Type: field.TypeUint64, Comment: "SOP 任务 ID"},
  279. }
  280. // SopStageTable holds the schema information for the "sop_stage" table.
  281. SopStageTable = &schema.Table{
  282. Name: "sop_stage",
  283. Columns: SopStageColumns,
  284. PrimaryKey: []*schema.Column{SopStageColumns[0]},
  285. ForeignKeys: []*schema.ForeignKey{
  286. {
  287. Symbol: "sop_stage_sop_task_task_stages",
  288. Columns: []*schema.Column{SopStageColumns[12]},
  289. RefColumns: []*schema.Column{SopTaskColumns[0]},
  290. OnDelete: schema.NoAction,
  291. },
  292. },
  293. Indexes: []*schema.Index{
  294. {
  295. Name: "sopstage_name",
  296. Unique: false,
  297. Columns: []*schema.Column{SopStageColumns[5]},
  298. },
  299. },
  300. }
  301. // SopTaskColumns holds the columns for the "sop_task" table.
  302. SopTaskColumns = []*schema.Column{
  303. {Name: "id", Type: field.TypeUint64, Increment: true},
  304. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  305. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  306. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  307. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  308. {Name: "name", Type: field.TypeString, Comment: "SOP 任务名称"},
  309. {Name: "bot_wxid_list", Type: field.TypeJSON, Nullable: true, Comment: "机器人微信 id 列表"},
  310. {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3企业微信联系人", Default: 1},
  311. {Name: "plan_start_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划开始时间"},
  312. {Name: "plan_end_time", Type: field.TypeTime, Nullable: true, Comment: "任务计划结束时间"},
  313. {Name: "creator_id", Type: field.TypeString, Nullable: true, Comment: "创建者 id"},
  314. }
  315. // SopTaskTable holds the schema information for the "sop_task" table.
  316. SopTaskTable = &schema.Table{
  317. Name: "sop_task",
  318. Columns: SopTaskColumns,
  319. PrimaryKey: []*schema.Column{SopTaskColumns[0]},
  320. Indexes: []*schema.Index{
  321. {
  322. Name: "soptask_name",
  323. Unique: false,
  324. Columns: []*schema.Column{SopTaskColumns[5]},
  325. },
  326. },
  327. }
  328. // WxColumns holds the columns for the "wx" table.
  329. WxColumns = []*schema.Column{
  330. {Name: "id", Type: field.TypeUint64, Increment: true},
  331. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  332. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  333. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  334. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  335. {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
  336. {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
  337. {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
  338. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  339. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  340. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
  341. {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
  342. {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
  343. {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
  344. }
  345. // WxTable holds the schema information for the "wx" table.
  346. WxTable = &schema.Table{
  347. Name: "wx",
  348. Columns: WxColumns,
  349. PrimaryKey: []*schema.Column{WxColumns[0]},
  350. ForeignKeys: []*schema.ForeignKey{
  351. {
  352. Symbol: "wx_server_wxs",
  353. Columns: []*schema.Column{WxColumns[13]},
  354. RefColumns: []*schema.Column{ServerColumns[0]},
  355. OnDelete: schema.SetNull,
  356. },
  357. },
  358. Indexes: []*schema.Index{
  359. {
  360. Name: "wx_server_id_port",
  361. Unique: true,
  362. Columns: []*schema.Column{WxColumns[13], WxColumns[5]},
  363. },
  364. {
  365. Name: "wx_wxid",
  366. Unique: true,
  367. Columns: []*schema.Column{WxColumns[8]},
  368. },
  369. {
  370. Name: "wx_account",
  371. Unique: false,
  372. Columns: []*schema.Column{WxColumns[9]},
  373. },
  374. {
  375. Name: "wx_nickname",
  376. Unique: false,
  377. Columns: []*schema.Column{WxColumns[10]},
  378. },
  379. {
  380. Name: "wx_tel",
  381. Unique: false,
  382. Columns: []*schema.Column{WxColumns[11]},
  383. },
  384. },
  385. }
  386. // Tables holds all the tables in the schema.
  387. Tables = []*schema.Table{
  388. ContactTable,
  389. LabelTable,
  390. LabelRelationshipTable,
  391. MessageTable,
  392. MessageRecordsTable,
  393. ServerTable,
  394. SopNodeTable,
  395. SopStageTable,
  396. SopTaskTable,
  397. WxTable,
  398. }
  399. )
  400. func init() {
  401. ContactTable.Annotation = &entsql.Annotation{
  402. Table: "contact",
  403. }
  404. LabelTable.Annotation = &entsql.Annotation{
  405. Table: "label",
  406. }
  407. LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable
  408. LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable
  409. LabelRelationshipTable.Annotation = &entsql.Annotation{
  410. Table: "label_relationship",
  411. }
  412. MessageTable.Annotation = &entsql.Annotation{
  413. Table: "message",
  414. }
  415. MessageRecordsTable.ForeignKeys[0].RefTable = ContactTable
  416. MessageRecordsTable.ForeignKeys[1].RefTable = SopNodeTable
  417. MessageRecordsTable.ForeignKeys[2].RefTable = SopStageTable
  418. MessageRecordsTable.Annotation = &entsql.Annotation{
  419. Table: "message_records",
  420. }
  421. ServerTable.Annotation = &entsql.Annotation{
  422. Table: "server",
  423. }
  424. SopNodeTable.ForeignKeys[0].RefTable = SopStageTable
  425. SopNodeTable.Annotation = &entsql.Annotation{
  426. Table: "sop_node",
  427. }
  428. SopStageTable.ForeignKeys[0].RefTable = SopTaskTable
  429. SopStageTable.Annotation = &entsql.Annotation{
  430. Table: "sop_stage",
  431. }
  432. SopTaskTable.Annotation = &entsql.Annotation{
  433. Table: "sop_task",
  434. }
  435. WxTable.ForeignKeys[0].RefTable = ServerTable
  436. WxTable.Annotation = &entsql.Annotation{
  437. Table: "wx",
  438. }
  439. }