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. // ContactsColumns holds the columns for the "contacts" table.
  40. ContactsColumns = []*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. // ContactsTable holds the schema information for the "contacts" table.
  63. ContactsTable = &schema.Table{
  64. Name: "contacts",
  65. Columns: ContactsColumns,
  66. PrimaryKey: []*schema.Column{ContactsColumns[0]},
  67. Indexes: []*schema.Index{
  68. {
  69. Name: "contact_wx_wxid_wxid",
  70. Unique: true,
  71. Columns: []*schema.Column{ContactsColumns[5], ContactsColumns[7]},
  72. },
  73. {
  74. Name: "contact_wxid",
  75. Unique: false,
  76. Columns: []*schema.Column{ContactsColumns[7]},
  77. },
  78. {
  79. Name: "contact_type",
  80. Unique: false,
  81. Columns: []*schema.Column{ContactsColumns[6]},
  82. },
  83. {
  84. Name: "contact_gid",
  85. Unique: false,
  86. Columns: []*schema.Column{ContactsColumns[17]},
  87. },
  88. },
  89. }
  90. // LabelsColumns holds the columns for the "labels" table.
  91. LabelsColumns = []*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. // LabelsTable holds the schema information for the "labels" table.
  104. LabelsTable = &schema.Table{
  105. Name: "labels",
  106. Columns: LabelsColumns,
  107. PrimaryKey: []*schema.Column{LabelsColumns[0]},
  108. Indexes: []*schema.Index{
  109. {
  110. Name: "label_name_from_mode",
  111. Unique: true,
  112. Columns: []*schema.Column{LabelsColumns[6], LabelsColumns[7], LabelsColumns[8]},
  113. },
  114. },
  115. }
  116. // LabelRelationshipsColumns holds the columns for the "label_relationships" table.
  117. LabelRelationshipsColumns = []*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. // LabelRelationshipsTable holds the schema information for the "label_relationships" table.
  127. LabelRelationshipsTable = &schema.Table{
  128. Name: "label_relationships",
  129. Columns: LabelRelationshipsColumns,
  130. PrimaryKey: []*schema.Column{LabelRelationshipsColumns[0]},
  131. ForeignKeys: []*schema.ForeignKey{
  132. {
  133. Symbol: "label_relationships_contacts_contact_relationships",
  134. Columns: []*schema.Column{LabelRelationshipsColumns[5]},
  135. RefColumns: []*schema.Column{ContactsColumns[0]},
  136. OnDelete: schema.NoAction,
  137. },
  138. {
  139. Symbol: "label_relationships_labels_label_relationships",
  140. Columns: []*schema.Column{LabelRelationshipsColumns[6]},
  141. RefColumns: []*schema.Column{LabelsColumns[0]},
  142. OnDelete: schema.NoAction,
  143. },
  144. },
  145. Indexes: []*schema.Index{
  146. {
  147. Name: "labelrelationship_label_id",
  148. Unique: false,
  149. Columns: []*schema.Column{LabelRelationshipsColumns[6]},
  150. },
  151. {
  152. Name: "labelrelationship_contact_id",
  153. Unique: false,
  154. Columns: []*schema.Column{LabelRelationshipsColumns[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. // MessageRecordssColumns holds the columns for the "message_recordss" table.
  172. MessageRecordssColumns = []*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. // MessageRecordssTable holds the schema information for the "message_recordss" table.
  192. MessageRecordssTable = &schema.Table{
  193. Name: "message_recordss",
  194. Columns: MessageRecordssColumns,
  195. PrimaryKey: []*schema.Column{MessageRecordssColumns[0]},
  196. ForeignKeys: []*schema.ForeignKey{
  197. {
  198. Symbol: "message_recordss_contacts_contact_messages",
  199. Columns: []*schema.Column{MessageRecordssColumns[14]},
  200. RefColumns: []*schema.Column{ContactsColumns[0]},
  201. OnDelete: schema.SetNull,
  202. },
  203. {
  204. Symbol: "message_recordss_sop_nodes_node_messages",
  205. Columns: []*schema.Column{MessageRecordssColumns[15]},
  206. RefColumns: []*schema.Column{SopNodesColumns[0]},
  207. OnDelete: schema.SetNull,
  208. },
  209. {
  210. Symbol: "message_recordss_sop_stages_stage_messages",
  211. Columns: []*schema.Column{MessageRecordssColumns[16]},
  212. RefColumns: []*schema.Column{SopStagesColumns[0]},
  213. OnDelete: schema.SetNull,
  214. },
  215. },
  216. Indexes: []*schema.Index{
  217. {
  218. Name: "messagerecords_source_type",
  219. Unique: false,
  220. Columns: []*schema.Column{MessageRecordssColumns[13]},
  221. },
  222. },
  223. }
  224. // ServersColumns holds the columns for the "servers" table.
  225. ServersColumns = []*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. // ServersTable holds the schema information for the "servers" table.
  237. ServersTable = &schema.Table{
  238. Name: "servers",
  239. Columns: ServersColumns,
  240. PrimaryKey: []*schema.Column{ServersColumns[0]},
  241. Indexes: []*schema.Index{
  242. {
  243. Name: "server_name",
  244. Unique: false,
  245. Columns: []*schema.Column{ServersColumns[5]},
  246. },
  247. {
  248. Name: "server_private_ip",
  249. Unique: false,
  250. Columns: []*schema.Column{ServersColumns[7]},
  251. },
  252. {
  253. Name: "server_public_ip",
  254. Unique: true,
  255. Columns: []*schema.Column{ServersColumns[6]},
  256. },
  257. },
  258. }
  259. // SopNodesColumns holds the columns for the "sop_nodes" table.
  260. SopNodesColumns = []*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. // SopNodesTable holds the schema information for the "sop_nodes" table.
  276. SopNodesTable = &schema.Table{
  277. Name: "sop_nodes",
  278. Columns: SopNodesColumns,
  279. PrimaryKey: []*schema.Column{SopNodesColumns[0]},
  280. ForeignKeys: []*schema.ForeignKey{
  281. {
  282. Symbol: "sop_nodes_sop_stages_stage_nodes",
  283. Columns: []*schema.Column{SopNodesColumns[12]},
  284. RefColumns: []*schema.Column{SopStagesColumns[0]},
  285. OnDelete: schema.NoAction,
  286. },
  287. },
  288. Indexes: []*schema.Index{
  289. {
  290. Name: "sopnode_name",
  291. Unique: false,
  292. Columns: []*schema.Column{SopNodesColumns[6]},
  293. },
  294. },
  295. }
  296. // SopStagesColumns holds the columns for the "sop_stages" table.
  297. SopStagesColumns = []*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. // SopStagesTable holds the schema information for the "sop_stages" table.
  313. SopStagesTable = &schema.Table{
  314. Name: "sop_stages",
  315. Columns: SopStagesColumns,
  316. PrimaryKey: []*schema.Column{SopStagesColumns[0]},
  317. ForeignKeys: []*schema.ForeignKey{
  318. {
  319. Symbol: "sop_stages_sop_tasks_task_stages",
  320. Columns: []*schema.Column{SopStagesColumns[12]},
  321. RefColumns: []*schema.Column{SopTasksColumns[0]},
  322. OnDelete: schema.NoAction,
  323. },
  324. },
  325. Indexes: []*schema.Index{
  326. {
  327. Name: "sopstage_name",
  328. Unique: false,
  329. Columns: []*schema.Column{SopStagesColumns[5]},
  330. },
  331. },
  332. }
  333. // SopTasksColumns holds the columns for the "sop_tasks" table.
  334. SopTasksColumns = []*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. // SopTasksTable holds the schema information for the "sop_tasks" table.
  348. SopTasksTable = &schema.Table{
  349. Name: "sop_tasks",
  350. Columns: SopTasksColumns,
  351. PrimaryKey: []*schema.Column{SopTasksColumns[0]},
  352. Indexes: []*schema.Index{
  353. {
  354. Name: "soptask_name",
  355. Unique: false,
  356. Columns: []*schema.Column{SopTasksColumns[5]},
  357. },
  358. },
  359. }
  360. // WxsColumns holds the columns for the "wxs" table.
  361. WxsColumns = []*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. // WxsTable holds the schema information for the "wxs" table.
  378. WxsTable = &schema.Table{
  379. Name: "wxs",
  380. Columns: WxsColumns,
  381. PrimaryKey: []*schema.Column{WxsColumns[0]},
  382. ForeignKeys: []*schema.ForeignKey{
  383. {
  384. Symbol: "wxs_servers_wxs",
  385. Columns: []*schema.Column{WxsColumns[13]},
  386. RefColumns: []*schema.Column{ServersColumns[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{WxsColumns[13], WxsColumns[5]},
  395. },
  396. {
  397. Name: "wx_wxid",
  398. Unique: true,
  399. Columns: []*schema.Column{WxsColumns[8]},
  400. },
  401. {
  402. Name: "wx_account",
  403. Unique: false,
  404. Columns: []*schema.Column{WxsColumns[9]},
  405. },
  406. {
  407. Name: "wx_nickname",
  408. Unique: false,
  409. Columns: []*schema.Column{WxsColumns[10]},
  410. },
  411. {
  412. Name: "wx_tel",
  413. Unique: false,
  414. Columns: []*schema.Column{WxsColumns[11]},
  415. },
  416. },
  417. }
  418. // Tables holds all the tables in the schema.
  419. Tables = []*schema.Table{
  420. BatchMsgTable,
  421. ContactsTable,
  422. LabelsTable,
  423. LabelRelationshipsTable,
  424. MessagesTable,
  425. MessageRecordssTable,
  426. ServersTable,
  427. SopNodesTable,
  428. SopStagesTable,
  429. SopTasksTable,
  430. WxsTable,
  431. }
  432. )
  433. func init() {
  434. BatchMsgTable.Annotation = &entsql.Annotation{
  435. Table: "batch_msg",
  436. }
  437. ContactsTable.Annotation = &entsql.Annotation{
  438. Table: "contacts",
  439. }
  440. LabelsTable.Annotation = &entsql.Annotation{
  441. Table: "labels",
  442. }
  443. LabelRelationshipsTable.ForeignKeys[0].RefTable = ContactsTable
  444. LabelRelationshipsTable.ForeignKeys[1].RefTable = LabelsTable
  445. LabelRelationshipsTable.Annotation = &entsql.Annotation{
  446. Table: "label_relationships",
  447. }
  448. MessagesTable.Annotation = &entsql.Annotation{
  449. Table: "messages",
  450. }
  451. MessageRecordssTable.ForeignKeys[0].RefTable = ContactsTable
  452. MessageRecordssTable.ForeignKeys[1].RefTable = SopNodesTable
  453. MessageRecordssTable.ForeignKeys[2].RefTable = SopStagesTable
  454. MessageRecordssTable.Annotation = &entsql.Annotation{
  455. Table: "message_recordss",
  456. }
  457. ServersTable.Annotation = &entsql.Annotation{
  458. Table: "servers",
  459. }
  460. SopNodesTable.ForeignKeys[0].RefTable = SopStagesTable
  461. SopNodesTable.Annotation = &entsql.Annotation{
  462. Table: "sop_nodes",
  463. }
  464. SopStagesTable.ForeignKeys[0].RefTable = SopTasksTable
  465. SopStagesTable.Annotation = &entsql.Annotation{
  466. Table: "sop_stages",
  467. }
  468. SopTasksTable.Annotation = &entsql.Annotation{
  469. Table: "sop_tasks",
  470. }
  471. WxsTable.ForeignKeys[0].RefTable = ServersTable
  472. WxsTable.Annotation = &entsql.Annotation{
  473. Table: "wxs",
  474. }
  475. }