|
|
@ -42,8 +42,8 @@ var (
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// SysDictionariesColumns holds the columns for the "sys_dictionaries" table.
|
|
|
|
// SysDictionaryColumns holds the columns for the "sys_dictionary" table.
|
|
|
|
SysDictionariesColumns = []*schema.Column{
|
|
|
|
SysDictionaryColumns = []*schema.Column{
|
|
|
|
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
|
|
|
|
{Name: "id", Type: field.TypeInt64, Comment: "Primary Key | 主键"},
|
|
|
|
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
@ -53,12 +53,12 @@ var (
|
|
|
|
{Name: "name", Type: field.TypeString, Unique: true, Comment: "The name of dictionary for search | 字典搜索名称"},
|
|
|
|
{Name: "name", Type: field.TypeString, Unique: true, Comment: "The name of dictionary for search | 字典搜索名称"},
|
|
|
|
{Name: "description", Type: field.TypeString, Nullable: true, Comment: "The description of dictionary | 字典的描述"},
|
|
|
|
{Name: "description", Type: field.TypeString, Nullable: true, Comment: "The description of dictionary | 字典的描述"},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// SysDictionariesTable holds the schema information for the "sys_dictionaries" table.
|
|
|
|
// SysDictionaryTable holds the schema information for the "sys_dictionary" table.
|
|
|
|
SysDictionariesTable = &schema.Table{
|
|
|
|
SysDictionaryTable = &schema.Table{
|
|
|
|
Name: "sys_dictionaries",
|
|
|
|
Name: "sys_dictionary",
|
|
|
|
Comment: "字典表",
|
|
|
|
Comment: "字典表",
|
|
|
|
Columns: SysDictionariesColumns,
|
|
|
|
Columns: SysDictionaryColumns,
|
|
|
|
PrimaryKey: []*schema.Column{SysDictionariesColumns[0]},
|
|
|
|
PrimaryKey: []*schema.Column{SysDictionaryColumns[0]},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// SysDictionaryDetailsColumns holds the columns for the "sys_dictionary_details" table.
|
|
|
|
// SysDictionaryDetailsColumns holds the columns for the "sys_dictionary_details" table.
|
|
|
|
SysDictionaryDetailsColumns = []*schema.Column{
|
|
|
|
SysDictionaryDetailsColumns = []*schema.Column{
|
|
|
@ -79,10 +79,10 @@ var (
|
|
|
|
PrimaryKey: []*schema.Column{SysDictionaryDetailsColumns[0]},
|
|
|
|
PrimaryKey: []*schema.Column{SysDictionaryDetailsColumns[0]},
|
|
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Symbol: "sys_dictionary_details_sys_dictionaries_details",
|
|
|
|
Symbol: "sys_dictionary_details_sys_dictionary_details",
|
|
|
|
Columns: []*schema.Column{SysDictionaryDetailsColumns[7]},
|
|
|
|
Columns: []*schema.Column{SysDictionaryDetailsColumns[7]},
|
|
|
|
RefColumns: []*schema.Column{SysDictionariesColumns[0]},
|
|
|
|
RefColumns: []*schema.Column{SysDictionaryColumns[0]},
|
|
|
|
OnDelete: schema.NoAction,
|
|
|
|
OnDelete: schema.Cascade,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,7 +133,7 @@ var (
|
|
|
|
Symbol: "sys_login_record_sys_user_loginRecord",
|
|
|
|
Symbol: "sys_login_record_sys_user_loginRecord",
|
|
|
|
Columns: []*schema.Column{SysLoginRecordColumns[9]},
|
|
|
|
Columns: []*schema.Column{SysLoginRecordColumns[9]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
OnDelete: schema.NoAction,
|
|
|
|
OnDelete: schema.Cascade,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -206,7 +206,7 @@ var (
|
|
|
|
Symbol: "sys_token_sys_user_token",
|
|
|
|
Symbol: "sys_token_sys_user_token",
|
|
|
|
Columns: []*schema.Column{SysTokenColumns[10]},
|
|
|
|
Columns: []*schema.Column{SysTokenColumns[10]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
OnDelete: schema.NoAction,
|
|
|
|
OnDelete: schema.Cascade,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -217,7 +217,6 @@ var (
|
|
|
|
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 更新时间", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
|
|
|
|
{Name: "version", Type: field.TypeInt64, Comment: "optimistic lock | 乐观锁", Default: 1},
|
|
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Soft delete | 软删除(逻辑删除)", SchemaType: map[string]string{"mysql": "datetime"}},
|
|
|
|
|
|
|
|
{Name: "username", Type: field.TypeString, Unique: true, Comment: "User's login name | 登录名"},
|
|
|
|
{Name: "username", Type: field.TypeString, Unique: true, Comment: "User's login name | 登录名"},
|
|
|
|
{Name: "phone_number", Type: field.TypeString, Unique: true, Nullable: true, Comment: "Phone number | 手机号"},
|
|
|
|
{Name: "phone_number", Type: field.TypeString, Unique: true, Nullable: true, Comment: "Phone number | 手机号"},
|
|
|
|
{Name: "email", Type: field.TypeString, Unique: true, Nullable: true, Comment: "Email | 邮箱号"},
|
|
|
|
{Name: "email", Type: field.TypeString, Unique: true, Nullable: true, Comment: "Email | 邮箱号"},
|
|
|
@ -252,7 +251,7 @@ var (
|
|
|
|
Symbol: "sys_usermeta_sys_user_metas",
|
|
|
|
Symbol: "sys_usermeta_sys_user_metas",
|
|
|
|
Columns: []*schema.Column{SysUsermetaColumns[6]},
|
|
|
|
Columns: []*schema.Column{SysUsermetaColumns[6]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
OnDelete: schema.NoAction,
|
|
|
|
OnDelete: schema.Cascade,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Indexes: []*schema.Index{
|
|
|
|
Indexes: []*schema.Index{
|
|
|
@ -300,7 +299,7 @@ var (
|
|
|
|
Symbol: "sys_user_social_sys_user_socials",
|
|
|
|
Symbol: "sys_user_social_sys_user_socials",
|
|
|
|
Columns: []*schema.Column{SysUserSocialColumns[12]},
|
|
|
|
Columns: []*schema.Column{SysUserSocialColumns[12]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
RefColumns: []*schema.Column{SysUserColumns[0]},
|
|
|
|
OnDelete: schema.NoAction,
|
|
|
|
OnDelete: schema.Cascade,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -357,7 +356,7 @@ var (
|
|
|
|
// Tables holds all the tables in the schema.
|
|
|
|
// Tables holds all the tables in the schema.
|
|
|
|
Tables = []*schema.Table{
|
|
|
|
Tables = []*schema.Table{
|
|
|
|
SysDepartmentTable,
|
|
|
|
SysDepartmentTable,
|
|
|
|
SysDictionariesTable,
|
|
|
|
SysDictionaryTable,
|
|
|
|
SysDictionaryDetailsTable,
|
|
|
|
SysDictionaryDetailsTable,
|
|
|
|
SysDistrictTable,
|
|
|
|
SysDistrictTable,
|
|
|
|
SysLoginRecordTable,
|
|
|
|
SysLoginRecordTable,
|
|
|
@ -378,10 +377,10 @@ func init() {
|
|
|
|
SysDepartmentTable.Annotation = &entsql.Annotation{
|
|
|
|
SysDepartmentTable.Annotation = &entsql.Annotation{
|
|
|
|
Table: "sys_department",
|
|
|
|
Table: "sys_department",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SysDictionariesTable.Annotation = &entsql.Annotation{
|
|
|
|
SysDictionaryTable.Annotation = &entsql.Annotation{
|
|
|
|
Table: "sys_dictionaries",
|
|
|
|
Table: "sys_dictionary",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SysDictionaryDetailsTable.ForeignKeys[0].RefTable = SysDictionariesTable
|
|
|
|
SysDictionaryDetailsTable.ForeignKeys[0].RefTable = SysDictionaryTable
|
|
|
|
SysDictionaryDetailsTable.Annotation = &entsql.Annotation{
|
|
|
|
SysDictionaryDetailsTable.Annotation = &entsql.Annotation{
|
|
|
|
Table: "sys_dictionary_details",
|
|
|
|
Table: "sys_dictionary_details",
|
|
|
|
}
|
|
|
|
}
|
|
|
|