// 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]},
			},
		},
	}
	// 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,
		ServerTable,
		WxTable,
	}
)

func init() {
	ContactTable.Annotation = &entsql.Annotation{
		Table: "contact",
	}
	ServerTable.Annotation = &entsql.Annotation{
		Table: "server",
	}
	WxTable.ForeignKeys[0].RefTable = ServerTable
	WxTable.Annotation = &entsql.Annotation{
		Table: "wx",
	}
}