schema.go 22 KB

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