// Code generated by ent, DO NOT EDIT. package migrate import ( "entgo.io/ent/dialect/entsql" "entgo.io/ent/dialect/sql/schema" "entgo.io/ent/schema/field" ) var ( // ContactColumns holds the columns for the "contact" table. ContactColumns = []*schema.Column{ {Name: "id", Type: field.TypeUint64, Increment: true}, {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"}, {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"}, {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""}, {Name: "type", Type: field.TypeInt, Nullable: true, Comment: "联系人类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1}, {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""}, {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""}, {Name: "nickname", Type: field.TypeString, Comment: "微信昵称 群备注名称", Default: ""}, {Name: "markname", Type: field.TypeString, Comment: "备注名", Default: ""}, {Name: "headimg", Type: field.TypeString, Comment: "头像", Default: ""}, {Name: "sex", Type: field.TypeInt, Comment: "性别 0未知 1男 2女", Default: 0}, {Name: "starrole", Type: field.TypeString, Comment: "星标 65/67=星标 1/3=未星标", Default: ""}, {Name: "dontseeit", Type: field.TypeInt, Comment: "不让他看我的朋友圈 0可以看 1不让看", Default: 0}, {Name: "dontseeme", Type: field.TypeInt, Comment: "不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天", Default: 0}, {Name: "lag", Type: field.TypeString, Comment: "所属标签id清单,多开会用逗号隔开", Default: ""}, {Name: "gid", Type: field.TypeString, Comment: "群组id", Default: ""}, {Name: "gname", Type: field.TypeString, Comment: "群组名称", Default: ""}, {Name: "v3", Type: field.TypeString, Comment: "v3数据", Default: ""}, } // ContactTable holds the schema information for the "contact" table. ContactTable = &schema.Table{ Name: "contact", Columns: ContactColumns, PrimaryKey: []*schema.Column{ContactColumns[0]}, Indexes: []*schema.Index{ { Name: "contact_wx_wxid_wxid", Unique: true, Columns: []*schema.Column{ContactColumns[5], ContactColumns[7]}, }, { Name: "contact_wxid", Unique: false, Columns: []*schema.Column{ContactColumns[7]}, }, { Name: "contact_type", Unique: false, Columns: []*schema.Column{ContactColumns[6]}, }, { Name: "contact_gid", Unique: false, Columns: []*schema.Column{ContactColumns[17]}, }, }, } // LabelColumns holds the columns for the "label" table. LabelColumns = []*schema.Column{ {Name: "id", Type: field.TypeUint64, Increment: true}, {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"}, {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"}, {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "type", Type: field.TypeInt, Comment: "标签类型:1好友,2群组,3公众号,4企业微信联系人", Default: 1}, {Name: "name", Type: field.TypeString, Comment: "标签名称", Default: ""}, {Name: "from", Type: field.TypeInt, Comment: "标签来源:1后台创建 2个微同步", Default: 1}, {Name: "mode", Type: field.TypeInt, Comment: "标签模式:1动态 2静态", Default: 1}, {Name: "conditions", Type: field.TypeString, Nullable: true, Comment: "标签的触达条件", Default: ""}, } // LabelTable holds the schema information for the "label" table. LabelTable = &schema.Table{ Name: "label", Columns: LabelColumns, PrimaryKey: []*schema.Column{LabelColumns[0]}, Indexes: []*schema.Index{ { Name: "label_name_from_mode", Unique: true, Columns: []*schema.Column{LabelColumns[6], LabelColumns[7], LabelColumns[8]}, }, }, } // LabelRelationshipColumns holds the columns for the "label_relationship" table. LabelRelationshipColumns = []*schema.Column{ {Name: "id", Type: field.TypeUint64, Increment: true}, {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"}, {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"}, {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "contact_id", Type: field.TypeUint64, Comment: "联系人 ID", Default: 1}, {Name: "label_id", Type: field.TypeUint64, Comment: "标签 ID", Default: 1}, } // LabelRelationshipTable holds the schema information for the "label_relationship" table. LabelRelationshipTable = &schema.Table{ Name: "label_relationship", Columns: LabelRelationshipColumns, PrimaryKey: []*schema.Column{LabelRelationshipColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "label_relationship_contact_contact_relationships", Columns: []*schema.Column{LabelRelationshipColumns[5]}, RefColumns: []*schema.Column{ContactColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "label_relationship_label_label_relationships", Columns: []*schema.Column{LabelRelationshipColumns[6]}, RefColumns: []*schema.Column{LabelColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "labelrelationship_label_id", Unique: false, Columns: []*schema.Column{LabelRelationshipColumns[6]}, }, { Name: "labelrelationship_contact_id", Unique: false, Columns: []*schema.Column{LabelRelationshipColumns[5]}, }, }, } // MessageColumns holds the columns for the "message" table. MessageColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "wx_wxid", Type: field.TypeString, Nullable: true, Comment: "属主微信id", Default: ""}, {Name: "wxid", Type: field.TypeString, Comment: "微信id 公众号微信ID", Default: ""}, {Name: "content", Type: field.TypeString, Comment: "微信消息内容", Default: ""}, } // MessageTable holds the schema information for the "message" table. MessageTable = &schema.Table{ Name: "message", Columns: MessageColumns, PrimaryKey: []*schema.Column{MessageColumns[0]}, } // ServerColumns holds the columns for the "server" table. ServerColumns = []*schema.Column{ {Name: "id", Type: field.TypeUint64, Increment: true}, {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"}, {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"}, {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "name", Type: field.TypeString, Comment: "名称"}, {Name: "public_ip", Type: field.TypeString, Comment: "公网ip"}, {Name: "private_ip", Type: field.TypeString, Comment: "内网ip"}, {Name: "admin_port", Type: field.TypeString, Comment: "管理端口"}, } // ServerTable holds the schema information for the "server" table. ServerTable = &schema.Table{ Name: "server", Columns: ServerColumns, PrimaryKey: []*schema.Column{ServerColumns[0]}, Indexes: []*schema.Index{ { Name: "server_name", Unique: false, Columns: []*schema.Column{ServerColumns[5]}, }, { Name: "server_private_ip", Unique: false, Columns: []*schema.Column{ServerColumns[7]}, }, { Name: "server_public_ip", Unique: true, Columns: []*schema.Column{ServerColumns[6]}, }, }, } // WxColumns holds the columns for the "wx" table. WxColumns = []*schema.Column{ {Name: "id", Type: field.TypeUint64, Increment: true}, {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"}, {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"}, {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "port", Type: field.TypeString, Comment: "端口号", Default: ""}, {Name: "process_id", Type: field.TypeString, Comment: "进程号", Default: ""}, {Name: "callback", Type: field.TypeString, Comment: "回调地址", Default: ""}, {Name: "wxid", Type: field.TypeString, Comment: "微信id", Default: ""}, {Name: "account", Type: field.TypeString, Comment: "微信账号", Default: ""}, {Name: "nickname", Type: field.TypeString, Comment: "微信昵称", Default: ""}, {Name: "tel", Type: field.TypeString, Comment: "手机号", Default: ""}, {Name: "head_big", Type: field.TypeString, Comment: "微信头像", Default: ""}, {Name: "server_id", Type: field.TypeUint64, Nullable: true, Comment: "服务器id", Default: 0}, } // WxTable holds the schema information for the "wx" table. WxTable = &schema.Table{ Name: "wx", Columns: WxColumns, PrimaryKey: []*schema.Column{WxColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "wx_server_wxs", Columns: []*schema.Column{WxColumns[13]}, RefColumns: []*schema.Column{ServerColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "wx_server_id_port", Unique: true, Columns: []*schema.Column{WxColumns[13], WxColumns[5]}, }, { Name: "wx_wxid", Unique: true, Columns: []*schema.Column{WxColumns[8]}, }, { Name: "wx_account", Unique: false, Columns: []*schema.Column{WxColumns[9]}, }, { Name: "wx_nickname", Unique: false, Columns: []*schema.Column{WxColumns[10]}, }, { Name: "wx_tel", Unique: false, Columns: []*schema.Column{WxColumns[11]}, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ ContactTable, LabelTable, LabelRelationshipTable, MessageTable, ServerTable, WxTable, } ) func init() { ContactTable.Annotation = &entsql.Annotation{ Table: "contact", } LabelTable.Annotation = &entsql.Annotation{ Table: "label", } LabelRelationshipTable.ForeignKeys[0].RefTable = ContactTable LabelRelationshipTable.ForeignKeys[1].RefTable = LabelTable LabelRelationshipTable.Annotation = &entsql.Annotation{ Table: "label_relationship", } MessageTable.Annotation = &entsql.Annotation{ Table: "message", } ServerTable.Annotation = &entsql.Annotation{ Table: "server", } WxTable.ForeignKeys[0].RefTable = ServerTable WxTable.Annotation = &entsql.Annotation{ Table: "wx", } }