// 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 ( // ScaAuthPermissionRuleColumns holds the columns for the "sca_auth_permission_rule" table. ScaAuthPermissionRuleColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt64, Increment: true, SchemaType: map[string]string{"mysql": "bigint(20) unsigned"}}, {Name: "ptype", Type: field.TypeString, Size: 100}, {Name: "v0", Type: field.TypeString, Size: 100}, {Name: "v1", Type: field.TypeString, Size: 100}, {Name: "v2", Type: field.TypeString, Nullable: true, Size: 100}, {Name: "v3", Type: field.TypeString, Nullable: true, Size: 100}, {Name: "v4", Type: field.TypeString, Nullable: true, Size: 100}, {Name: "v5", Type: field.TypeString, Nullable: true, Size: 100}, {Name: "sca_auth_role_sca_auth_permission_rule", Type: field.TypeInt64, Nullable: true, SchemaType: map[string]string{"mysql": "bigint(20)"}}, } // ScaAuthPermissionRuleTable holds the schema information for the "sca_auth_permission_rule" table. ScaAuthPermissionRuleTable = &schema.Table{ Name: "sca_auth_permission_rule", Comment: "角色权限规则表", Columns: ScaAuthPermissionRuleColumns, PrimaryKey: []*schema.Column{ScaAuthPermissionRuleColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sca_auth_permission_rule_sca_auth_role_sca_auth_permission_rule", Columns: []*schema.Column{ScaAuthPermissionRuleColumns[8]}, RefColumns: []*schema.Column{ScaAuthRoleColumns[0]}, OnDelete: schema.SetNull, }, }, } // ScaAuthRoleColumns holds the columns for the "sca_auth_role" table. ScaAuthRoleColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt64, Increment: true, Comment: "主键ID", SchemaType: map[string]string{"mysql": "bigint(20)"}}, {Name: "created_at", Type: field.TypeTime, Comment: "创建时间"}, {Name: "updated_at", Type: field.TypeTime, Comment: "更新时间"}, {Name: "deleted", Type: field.TypeInt8, Nullable: true, Comment: "是否删除 0 未删除 1 已删除", Default: 0}, {Name: "role_name", Type: field.TypeString, Size: 32, Comment: "角色名称"}, {Name: "role_key", Type: field.TypeString, Size: 64, Comment: "角色关键字"}, } // ScaAuthRoleTable holds the schema information for the "sca_auth_role" table. ScaAuthRoleTable = &schema.Table{ Name: "sca_auth_role", Comment: "角色表", Columns: ScaAuthRoleColumns, PrimaryKey: []*schema.Column{ScaAuthRoleColumns[0]}, } // ScaAuthUserColumns holds the columns for the "sca_auth_user" table. ScaAuthUserColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt64, Increment: true, Comment: "自增ID", SchemaType: map[string]string{"mysql": "bigint(20)"}}, {Name: "created_at", Type: field.TypeTime, Comment: "创建时间"}, {Name: "updated_at", Type: field.TypeTime, Comment: "更新时间"}, {Name: "deleted", Type: field.TypeInt8, Nullable: true, Comment: "是否删除 0 未删除 1 已删除", Default: 0}, {Name: "uid", Type: field.TypeString, Unique: true, Size: 20, Comment: "唯一ID"}, {Name: "username", Type: field.TypeString, Nullable: true, Size: 32, Comment: "用户名"}, {Name: "nickname", Type: field.TypeString, Nullable: true, Size: 32, Comment: "昵称"}, {Name: "email", Type: field.TypeString, Nullable: true, Size: 32, Comment: "邮箱"}, {Name: "phone", Type: field.TypeString, Nullable: true, Size: 32, Comment: "电话"}, {Name: "password", Type: field.TypeString, Nullable: true, Size: 64, Comment: "密码"}, {Name: "gender", Type: field.TypeString, Nullable: true, Size: 32, Comment: "性别"}, {Name: "avatar", Type: field.TypeString, Nullable: true, Comment: "头像"}, {Name: "status", Type: field.TypeInt8, Nullable: true, Comment: "状态 0 正常 1 封禁", Default: 0}, {Name: "introduce", Type: field.TypeString, Nullable: true, Size: 255, Comment: "介绍"}, {Name: "blog", Type: field.TypeString, Nullable: true, Size: 30, Comment: "博客"}, {Name: "location", Type: field.TypeString, Nullable: true, Size: 50, Comment: "地址"}, {Name: "company", Type: field.TypeString, Nullable: true, Size: 50, Comment: "公司"}, } // ScaAuthUserTable holds the schema information for the "sca_auth_user" table. ScaAuthUserTable = &schema.Table{ Name: "sca_auth_user", Comment: "用户表", Columns: ScaAuthUserColumns, PrimaryKey: []*schema.Column{ScaAuthUserColumns[0]}, Indexes: []*schema.Index{ { Name: "scaauthuser_id", Unique: true, Columns: []*schema.Column{ScaAuthUserColumns[0]}, }, { Name: "scaauthuser_uid", Unique: true, Columns: []*schema.Column{ScaAuthUserColumns[4]}, }, { Name: "scaauthuser_phone", Unique: true, Columns: []*schema.Column{ScaAuthUserColumns[8]}, }, }, } // ScaAuthUserDeviceColumns holds the columns for the "sca_auth_user_device" table. ScaAuthUserDeviceColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt64, Increment: true, Comment: "主键ID", SchemaType: map[string]string{"mysql": "bigint(20)"}}, {Name: "created_at", Type: field.TypeTime, Comment: "创建时间"}, {Name: "updated_at", Type: field.TypeTime, Comment: "更新时间"}, {Name: "deleted", Type: field.TypeInt8, Nullable: true, Comment: "是否删除 0 未删除 1 已删除", Default: 0}, {Name: "user_id", Type: field.TypeString, Size: 20, Comment: "用户ID"}, {Name: "ip", Type: field.TypeString, Size: 20, Comment: "登录IP"}, {Name: "location", Type: field.TypeString, Size: 20, Comment: "地址"}, {Name: "agent", Type: field.TypeString, Size: 255, Comment: "设备信息"}, {Name: "browser", Type: field.TypeString, Size: 20, Comment: "浏览器"}, {Name: "operating_system", Type: field.TypeString, Size: 20, Comment: "操作系统"}, {Name: "browser_version", Type: field.TypeString, Size: 20, Comment: "浏览器版本"}, {Name: "mobile", Type: field.TypeInt, Comment: "是否为手机 0否1是"}, {Name: "bot", Type: field.TypeInt, Comment: "是否为bot 0否1是"}, {Name: "mozilla", Type: field.TypeString, Size: 10, Comment: "火狐版本"}, {Name: "platform", Type: field.TypeString, Size: 20, Comment: "平台"}, {Name: "engine_name", Type: field.TypeString, Size: 20, Comment: "引擎名称"}, {Name: "engine_version", Type: field.TypeString, Size: 20, Comment: "引擎版本"}, {Name: "sca_auth_user_sca_auth_user_device", Type: field.TypeInt64, Nullable: true, SchemaType: map[string]string{"mysql": "bigint(20)"}}, } // ScaAuthUserDeviceTable holds the schema information for the "sca_auth_user_device" table. ScaAuthUserDeviceTable = &schema.Table{ Name: "sca_auth_user_device", Comment: "用户设备表", Columns: ScaAuthUserDeviceColumns, PrimaryKey: []*schema.Column{ScaAuthUserDeviceColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sca_auth_user_device_sca_auth_user_sca_auth_user_device", Columns: []*schema.Column{ScaAuthUserDeviceColumns[17]}, RefColumns: []*schema.Column{ScaAuthUserColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "scaauthuserdevice_id", Unique: true, Columns: []*schema.Column{ScaAuthUserDeviceColumns[0]}, }, }, } // ScaAuthUserSocialColumns holds the columns for the "sca_auth_user_social" table. ScaAuthUserSocialColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt64, Increment: true, Comment: "主键ID", SchemaType: map[string]string{"mysql": "bigint(20)"}}, {Name: "created_at", Type: field.TypeTime, Comment: "创建时间"}, {Name: "updated_at", Type: field.TypeTime, Comment: "更新时间"}, {Name: "deleted", Type: field.TypeInt8, Nullable: true, Comment: "是否删除 0 未删除 1 已删除", Default: 0}, {Name: "user_id", Type: field.TypeString, Size: 20, Comment: "用户ID"}, {Name: "open_id", Type: field.TypeString, Size: 50, Comment: "第三方用户的 open id"}, {Name: "source", Type: field.TypeString, Size: 10, Comment: "第三方用户来源"}, {Name: "status", Type: field.TypeInt, Comment: "状态 0正常 1 封禁", Default: 0}, {Name: "sca_auth_user_sca_auth_user_social", Type: field.TypeInt64, Nullable: true, SchemaType: map[string]string{"mysql": "bigint(20)"}}, } // ScaAuthUserSocialTable holds the schema information for the "sca_auth_user_social" table. ScaAuthUserSocialTable = &schema.Table{ Name: "sca_auth_user_social", Comment: "用户第三方登录信息", Columns: ScaAuthUserSocialColumns, PrimaryKey: []*schema.Column{ScaAuthUserSocialColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "sca_auth_user_social_sca_auth_user_sca_auth_user_social", Columns: []*schema.Column{ScaAuthUserSocialColumns[8]}, RefColumns: []*schema.Column{ScaAuthUserColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "scaauthusersocial_id", Unique: true, Columns: []*schema.Column{ScaAuthUserSocialColumns[0]}, }, { Name: "scaauthusersocial_user_id", Unique: true, Columns: []*schema.Column{ScaAuthUserSocialColumns[4]}, }, { Name: "scaauthusersocial_open_id", Unique: true, Columns: []*schema.Column{ScaAuthUserSocialColumns[5]}, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ ScaAuthPermissionRuleTable, ScaAuthRoleTable, ScaAuthUserTable, ScaAuthUserDeviceTable, ScaAuthUserSocialTable, } ) func init() { ScaAuthPermissionRuleTable.ForeignKeys[0].RefTable = ScaAuthRoleTable ScaAuthPermissionRuleTable.Annotation = &entsql.Annotation{ Table: "sca_auth_permission_rule", } ScaAuthRoleTable.Annotation = &entsql.Annotation{ Table: "sca_auth_role", } ScaAuthUserTable.Annotation = &entsql.Annotation{ Table: "sca_auth_user", } ScaAuthUserDeviceTable.ForeignKeys[0].RefTable = ScaAuthUserTable ScaAuthUserDeviceTable.Annotation = &entsql.Annotation{ Table: "sca_auth_user_device", } ScaAuthUserSocialTable.ForeignKeys[0].RefTable = ScaAuthUserTable ScaAuthUserSocialTable.Annotation = &entsql.Annotation{ Table: "sca_auth_user_social", } }