schema.go 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. // ServerColumns holds the columns for the "server" table.
  61. ServerColumns = []*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: "name", Type: field.TypeString, Comment: "名称"},
  68. {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"},
  69. {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"},
  70. {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"},
  71. }
  72. // ServerTable holds the schema information for the "server" table.
  73. ServerTable = &schema.Table{
  74. Name: "server",
  75. Columns: ServerColumns,
  76. PrimaryKey: []*schema.Column{ServerColumns[0]},
  77. Indexes: []*schema.Index{
  78. {
  79. Name: "server_name",
  80. Unique: false,
  81. Columns: []*schema.Column{ServerColumns[5]},
  82. },
  83. {
  84. Name: "server_private_ip",
  85. Unique: false,
  86. Columns: []*schema.Column{ServerColumns[7]},
  87. },
  88. {
  89. Name: "server_public_ip",
  90. Unique: true,
  91. Columns: []*schema.Column{ServerColumns[6]},
  92. },
  93. },
  94. }
  95. // WxColumns holds the columns for the "wx" table.
  96. WxColumns = []*schema.Column{
  97. {Name: "id", Type: field.TypeUint64, Increment: true},
  98. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  99. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  100. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  101. {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
  102. {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""},
  103. {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""},
  104. {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""},
  105. {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""},
  106. {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""},
  107. {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""},
  108. {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""},
  109. {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""},
  110. {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0},
  111. }
  112. // WxTable holds the schema information for the "wx" table.
  113. WxTable = &schema.Table{
  114. Name: "wx",
  115. Columns: WxColumns,
  116. PrimaryKey: []*schema.Column{WxColumns[0]},
  117. ForeignKeys: []*schema.ForeignKey{
  118. {
  119. Symbol: "wx_server_wxs",
  120. Columns: []*schema.Column{WxColumns[13]},
  121. RefColumns: []*schema.Column{ServerColumns[0]},
  122. OnDelete: schema.SetNull,
  123. },
  124. },
  125. Indexes: []*schema.Index{
  126. {
  127. Name: "wx_server_id_port",
  128. Unique: true,
  129. Columns: []*schema.Column{WxColumns[13], WxColumns[5]},
  130. },
  131. {
  132. Name: "wx_wxid",
  133. Unique: true,
  134. Columns: []*schema.Column{WxColumns[8]},
  135. },
  136. {
  137. Name: "wx_account",
  138. Unique: false,
  139. Columns: []*schema.Column{WxColumns[9]},
  140. },
  141. {
  142. Name: "wx_nickname",
  143. Unique: false,
  144. Columns: []*schema.Column{WxColumns[10]},
  145. },
  146. {
  147. Name: "wx_tel",
  148. Unique: false,
  149. Columns: []*schema.Column{WxColumns[11]},
  150. },
  151. },
  152. }
  153. // Tables holds all the tables in the schema.
  154. Tables = []*schema.Table{
  155. ContactTable,
  156. ServerTable,
  157. WxTable,
  158. }
  159. )
  160. func init() {
  161. ContactTable.Annotation = &entsql.Annotation{
  162. Table: "contact",
  163. }
  164. ServerTable.Annotation = &entsql.Annotation{
  165. Table: "server",
  166. }
  167. WxTable.ForeignKeys[0].RefTable = ServerTable
  168. WxTable.Annotation = &entsql.Annotation{
  169. Table: "wx",
  170. }
  171. }