From 8a772e3edfb4b795e68329a21f489fb1f2791e59 Mon Sep 17 00:00:00 2001 From: KinjiKawaguchi Date: Sat, 23 Mar 2024 15:28:58 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=B1=E3=83=BC=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/repository/ent/mutation.go | 36 ++++++------ .../domain/repository/ent/runtime.go | 12 ++-- .../domain/repository/ent/schema/user.go | 6 +- typing-server/domain/repository/ent/user.go | 16 +++--- .../domain/repository/ent/user/user.go | 12 ++-- .../domain/repository/ent/user/where.go | 56 +++++++++---------- .../domain/repository/ent/user_create.go | 12 ++-- .../domain/repository/ent/user_query.go | 4 +- .../domain/repository/ent/user_update.go | 24 ++++---- 9 files changed, 89 insertions(+), 89 deletions(-) diff --git a/typing-server/domain/repository/ent/mutation.go b/typing-server/domain/repository/ent/mutation.go index 1f505a9..7c149eb 100644 --- a/typing-server/domain/repository/ent/mutation.go +++ b/typing-server/domain/repository/ent/mutation.go @@ -545,8 +545,8 @@ type UserMutation struct { op Op typ string id *uuid.UUID - _StudentNumber *string - _HandleName *string + student_number *string + handle_name *string created_at *time.Time updated_at *time.Time clearedFields map[string]struct{} @@ -662,21 +662,21 @@ func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error) { } } -// SetStudentNumber sets the "StudentNumber" field. +// SetStudentNumber sets the "student_number" field. func (m *UserMutation) SetStudentNumber(s string) { - m._StudentNumber = &s + m.student_number = &s } -// StudentNumber returns the value of the "StudentNumber" field in the mutation. +// StudentNumber returns the value of the "student_number" field in the mutation. func (m *UserMutation) StudentNumber() (r string, exists bool) { - v := m._StudentNumber + v := m.student_number if v == nil { return } return *v, true } -// OldStudentNumber returns the old "StudentNumber" field's value of the User entity. +// OldStudentNumber returns the old "student_number" field's value of the User entity. // If the User object wasn't provided to the builder, the object is fetched from the database. // An error is returned if the mutation operation is not UpdateOne, or the database query fails. func (m *UserMutation) OldStudentNumber(ctx context.Context) (v string, err error) { @@ -693,26 +693,26 @@ func (m *UserMutation) OldStudentNumber(ctx context.Context) (v string, err erro return oldValue.StudentNumber, nil } -// ResetStudentNumber resets all changes to the "StudentNumber" field. +// ResetStudentNumber resets all changes to the "student_number" field. func (m *UserMutation) ResetStudentNumber() { - m._StudentNumber = nil + m.student_number = nil } -// SetHandleName sets the "HandleName" field. +// SetHandleName sets the "handle_name" field. func (m *UserMutation) SetHandleName(s string) { - m._HandleName = &s + m.handle_name = &s } -// HandleName returns the value of the "HandleName" field in the mutation. +// HandleName returns the value of the "handle_name" field in the mutation. func (m *UserMutation) HandleName() (r string, exists bool) { - v := m._HandleName + v := m.handle_name if v == nil { return } return *v, true } -// OldHandleName returns the old "HandleName" field's value of the User entity. +// OldHandleName returns the old "handle_name" field's value of the User entity. // If the User object wasn't provided to the builder, the object is fetched from the database. // An error is returned if the mutation operation is not UpdateOne, or the database query fails. func (m *UserMutation) OldHandleName(ctx context.Context) (v string, err error) { @@ -729,9 +729,9 @@ func (m *UserMutation) OldHandleName(ctx context.Context) (v string, err error) return oldValue.HandleName, nil } -// ResetHandleName resets all changes to the "HandleName" field. +// ResetHandleName resets all changes to the "handle_name" field. func (m *UserMutation) ResetHandleName() { - m._HandleName = nil + m.handle_name = nil } // SetCreatedAt sets the "created_at" field. @@ -895,10 +895,10 @@ func (m *UserMutation) Type() string { // AddedFields(). func (m *UserMutation) Fields() []string { fields := make([]string, 0, 4) - if m._StudentNumber != nil { + if m.student_number != nil { fields = append(fields, user.FieldStudentNumber) } - if m._HandleName != nil { + if m.handle_name != nil { fields = append(fields, user.FieldHandleName) } if m.created_at != nil { diff --git a/typing-server/domain/repository/ent/runtime.go b/typing-server/domain/repository/ent/runtime.go index 7ac9c43..569ca40 100644 --- a/typing-server/domain/repository/ent/runtime.go +++ b/typing-server/domain/repository/ent/runtime.go @@ -23,22 +23,22 @@ func init() { score.DefaultID = scoreDescID.Default.(func() uuid.UUID) userFields := schema.User{}.Fields() _ = userFields - // userDescStudentNumber is the schema descriptor for StudentNumber field. + // userDescStudentNumber is the schema descriptor for student_number field. userDescStudentNumber := userFields[1].Descriptor() - // user.StudentNumberValidator is a validator for the "StudentNumber" field. It is called by the builders before save. + // user.StudentNumberValidator is a validator for the "student_number" field. It is called by the builders before save. user.StudentNumberValidator = userDescStudentNumber.Validators[0].(func(string) error) - // userDescHandleName is the schema descriptor for HandleName field. + // userDescHandleName is the schema descriptor for handle_name field. userDescHandleName := userFields[2].Descriptor() - // user.HandleNameValidator is a validator for the "HandleName" field. It is called by the builders before save. + // user.HandleNameValidator is a validator for the "handle_name" field. It is called by the builders before save. user.HandleNameValidator = func() func(string) error { validators := userDescHandleName.Validators fns := [...]func(string) error{ validators[0].(func(string) error), validators[1].(func(string) error), } - return func(_HandleName string) error { + return func(handle_name string) error { for _, fn := range fns { - if err := fn(_HandleName); err != nil { + if err := fn(handle_name); err != nil { return err } } diff --git a/typing-server/domain/repository/ent/schema/user.go b/typing-server/domain/repository/ent/schema/user.go index b4a949d..b2c3389 100644 --- a/typing-server/domain/repository/ent/schema/user.go +++ b/typing-server/domain/repository/ent/schema/user.go @@ -19,9 +19,9 @@ func (User) Fields() []ent.Field { //カラムとしてvarcher型(255)のMailAdress,varcher型(255)のHandleName,varcher型(255)のName,varcher型(255)のHashedPassword,enum型のDepartment,datetime型のCreatedAt,datetime型のUpdatedAtを持たせる return []ent.Field{ field.UUID("id", uuid.UUID{}).Default(uuid.New).StorageKey("id").Unique(), - field.String("StudentNumber").NotEmpty().Unique(), - // field.String("MailAdress").NotEmpty().MaxLen(255), - field.String("HandleName").NotEmpty().MaxLen(36), + field.String("student_number").NotEmpty().Unique(), + // field.String("mail_address").NotEmpty().MaxLen(255), + field.String("handle_name").NotEmpty().MaxLen(36), // field.String("Name").NotEmpty().MaxLen(36), // field.String("HashedPassword").NotEmpty().MaxLen(255), // field.Enum("Department").Values("CS", "BI", "IA"), diff --git a/typing-server/domain/repository/ent/user.go b/typing-server/domain/repository/ent/user.go index 23e39d5..48edffc 100644 --- a/typing-server/domain/repository/ent/user.go +++ b/typing-server/domain/repository/ent/user.go @@ -18,10 +18,10 @@ type User struct { config `json:"-"` // ID of the ent. ID uuid.UUID `json:"id,omitempty"` - // StudentNumber holds the value of the "StudentNumber" field. - StudentNumber string `json:"StudentNumber,omitempty"` - // HandleName holds the value of the "HandleName" field. - HandleName string `json:"HandleName,omitempty"` + // StudentNumber holds the value of the "student_number" field. + StudentNumber string `json:"student_number,omitempty"` + // HandleName holds the value of the "handle_name" field. + HandleName string `json:"handle_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. @@ -84,13 +84,13 @@ func (u *User) assignValues(columns []string, values []any) error { } case user.FieldStudentNumber: if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field StudentNumber", values[i]) + return fmt.Errorf("unexpected type %T for field student_number", values[i]) } else if value.Valid { u.StudentNumber = value.String } case user.FieldHandleName: if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field HandleName", values[i]) + return fmt.Errorf("unexpected type %T for field handle_name", values[i]) } else if value.Valid { u.HandleName = value.String } @@ -147,10 +147,10 @@ func (u *User) String() string { var builder strings.Builder builder.WriteString("User(") builder.WriteString(fmt.Sprintf("id=%v, ", u.ID)) - builder.WriteString("StudentNumber=") + builder.WriteString("student_number=") builder.WriteString(u.StudentNumber) builder.WriteString(", ") - builder.WriteString("HandleName=") + builder.WriteString("handle_name=") builder.WriteString(u.HandleName) builder.WriteString(", ") builder.WriteString("created_at=") diff --git a/typing-server/domain/repository/ent/user/user.go b/typing-server/domain/repository/ent/user/user.go index 0cf6fe4..46991e3 100644 --- a/typing-server/domain/repository/ent/user/user.go +++ b/typing-server/domain/repository/ent/user/user.go @@ -15,9 +15,9 @@ const ( Label = "user" // FieldID holds the string denoting the id field in the database. FieldID = "id" - // FieldStudentNumber holds the string denoting the studentnumber field in the database. + // FieldStudentNumber holds the string denoting the student_number field in the database. FieldStudentNumber = "student_number" - // FieldHandleName holds the string denoting the handlename field in the database. + // FieldHandleName holds the string denoting the handle_name field in the database. FieldHandleName = "handle_name" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" @@ -56,9 +56,9 @@ func ValidColumn(column string) bool { } var ( - // StudentNumberValidator is a validator for the "StudentNumber" field. It is called by the builders before save. + // StudentNumberValidator is a validator for the "student_number" field. It is called by the builders before save. StudentNumberValidator func(string) error - // HandleNameValidator is a validator for the "HandleName" field. It is called by the builders before save. + // HandleNameValidator is a validator for the "handle_name" field. It is called by the builders before save. HandleNameValidator func(string) error // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time @@ -78,12 +78,12 @@ func ByID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldID, opts...).ToFunc() } -// ByStudentNumber orders the results by the StudentNumber field. +// ByStudentNumber orders the results by the student_number field. func ByStudentNumber(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStudentNumber, opts...).ToFunc() } -// ByHandleName orders the results by the HandleName field. +// ByHandleName orders the results by the handle_name field. func ByHandleName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldHandleName, opts...).ToFunc() } diff --git a/typing-server/domain/repository/ent/user/where.go b/typing-server/domain/repository/ent/user/where.go index 0653f73..1cb262d 100644 --- a/typing-server/domain/repository/ent/user/where.go +++ b/typing-server/domain/repository/ent/user/where.go @@ -56,12 +56,12 @@ func IDLTE(id uuid.UUID) predicate.User { return predicate.User(sql.FieldLTE(FieldID, id)) } -// StudentNumber applies equality check predicate on the "StudentNumber" field. It's identical to StudentNumberEQ. +// StudentNumber applies equality check predicate on the "student_number" field. It's identical to StudentNumberEQ. func StudentNumber(v string) predicate.User { return predicate.User(sql.FieldEQ(FieldStudentNumber, v)) } -// HandleName applies equality check predicate on the "HandleName" field. It's identical to HandleNameEQ. +// HandleName applies equality check predicate on the "handle_name" field. It's identical to HandleNameEQ. func HandleName(v string) predicate.User { return predicate.User(sql.FieldEQ(FieldHandleName, v)) } @@ -76,132 +76,132 @@ func UpdatedAt(v time.Time) predicate.User { return predicate.User(sql.FieldEQ(FieldUpdatedAt, v)) } -// StudentNumberEQ applies the EQ predicate on the "StudentNumber" field. +// StudentNumberEQ applies the EQ predicate on the "student_number" field. func StudentNumberEQ(v string) predicate.User { return predicate.User(sql.FieldEQ(FieldStudentNumber, v)) } -// StudentNumberNEQ applies the NEQ predicate on the "StudentNumber" field. +// StudentNumberNEQ applies the NEQ predicate on the "student_number" field. func StudentNumberNEQ(v string) predicate.User { return predicate.User(sql.FieldNEQ(FieldStudentNumber, v)) } -// StudentNumberIn applies the In predicate on the "StudentNumber" field. +// StudentNumberIn applies the In predicate on the "student_number" field. func StudentNumberIn(vs ...string) predicate.User { return predicate.User(sql.FieldIn(FieldStudentNumber, vs...)) } -// StudentNumberNotIn applies the NotIn predicate on the "StudentNumber" field. +// StudentNumberNotIn applies the NotIn predicate on the "student_number" field. func StudentNumberNotIn(vs ...string) predicate.User { return predicate.User(sql.FieldNotIn(FieldStudentNumber, vs...)) } -// StudentNumberGT applies the GT predicate on the "StudentNumber" field. +// StudentNumberGT applies the GT predicate on the "student_number" field. func StudentNumberGT(v string) predicate.User { return predicate.User(sql.FieldGT(FieldStudentNumber, v)) } -// StudentNumberGTE applies the GTE predicate on the "StudentNumber" field. +// StudentNumberGTE applies the GTE predicate on the "student_number" field. func StudentNumberGTE(v string) predicate.User { return predicate.User(sql.FieldGTE(FieldStudentNumber, v)) } -// StudentNumberLT applies the LT predicate on the "StudentNumber" field. +// StudentNumberLT applies the LT predicate on the "student_number" field. func StudentNumberLT(v string) predicate.User { return predicate.User(sql.FieldLT(FieldStudentNumber, v)) } -// StudentNumberLTE applies the LTE predicate on the "StudentNumber" field. +// StudentNumberLTE applies the LTE predicate on the "student_number" field. func StudentNumberLTE(v string) predicate.User { return predicate.User(sql.FieldLTE(FieldStudentNumber, v)) } -// StudentNumberContains applies the Contains predicate on the "StudentNumber" field. +// StudentNumberContains applies the Contains predicate on the "student_number" field. func StudentNumberContains(v string) predicate.User { return predicate.User(sql.FieldContains(FieldStudentNumber, v)) } -// StudentNumberHasPrefix applies the HasPrefix predicate on the "StudentNumber" field. +// StudentNumberHasPrefix applies the HasPrefix predicate on the "student_number" field. func StudentNumberHasPrefix(v string) predicate.User { return predicate.User(sql.FieldHasPrefix(FieldStudentNumber, v)) } -// StudentNumberHasSuffix applies the HasSuffix predicate on the "StudentNumber" field. +// StudentNumberHasSuffix applies the HasSuffix predicate on the "student_number" field. func StudentNumberHasSuffix(v string) predicate.User { return predicate.User(sql.FieldHasSuffix(FieldStudentNumber, v)) } -// StudentNumberEqualFold applies the EqualFold predicate on the "StudentNumber" field. +// StudentNumberEqualFold applies the EqualFold predicate on the "student_number" field. func StudentNumberEqualFold(v string) predicate.User { return predicate.User(sql.FieldEqualFold(FieldStudentNumber, v)) } -// StudentNumberContainsFold applies the ContainsFold predicate on the "StudentNumber" field. +// StudentNumberContainsFold applies the ContainsFold predicate on the "student_number" field. func StudentNumberContainsFold(v string) predicate.User { return predicate.User(sql.FieldContainsFold(FieldStudentNumber, v)) } -// HandleNameEQ applies the EQ predicate on the "HandleName" field. +// HandleNameEQ applies the EQ predicate on the "handle_name" field. func HandleNameEQ(v string) predicate.User { return predicate.User(sql.FieldEQ(FieldHandleName, v)) } -// HandleNameNEQ applies the NEQ predicate on the "HandleName" field. +// HandleNameNEQ applies the NEQ predicate on the "handle_name" field. func HandleNameNEQ(v string) predicate.User { return predicate.User(sql.FieldNEQ(FieldHandleName, v)) } -// HandleNameIn applies the In predicate on the "HandleName" field. +// HandleNameIn applies the In predicate on the "handle_name" field. func HandleNameIn(vs ...string) predicate.User { return predicate.User(sql.FieldIn(FieldHandleName, vs...)) } -// HandleNameNotIn applies the NotIn predicate on the "HandleName" field. +// HandleNameNotIn applies the NotIn predicate on the "handle_name" field. func HandleNameNotIn(vs ...string) predicate.User { return predicate.User(sql.FieldNotIn(FieldHandleName, vs...)) } -// HandleNameGT applies the GT predicate on the "HandleName" field. +// HandleNameGT applies the GT predicate on the "handle_name" field. func HandleNameGT(v string) predicate.User { return predicate.User(sql.FieldGT(FieldHandleName, v)) } -// HandleNameGTE applies the GTE predicate on the "HandleName" field. +// HandleNameGTE applies the GTE predicate on the "handle_name" field. func HandleNameGTE(v string) predicate.User { return predicate.User(sql.FieldGTE(FieldHandleName, v)) } -// HandleNameLT applies the LT predicate on the "HandleName" field. +// HandleNameLT applies the LT predicate on the "handle_name" field. func HandleNameLT(v string) predicate.User { return predicate.User(sql.FieldLT(FieldHandleName, v)) } -// HandleNameLTE applies the LTE predicate on the "HandleName" field. +// HandleNameLTE applies the LTE predicate on the "handle_name" field. func HandleNameLTE(v string) predicate.User { return predicate.User(sql.FieldLTE(FieldHandleName, v)) } -// HandleNameContains applies the Contains predicate on the "HandleName" field. +// HandleNameContains applies the Contains predicate on the "handle_name" field. func HandleNameContains(v string) predicate.User { return predicate.User(sql.FieldContains(FieldHandleName, v)) } -// HandleNameHasPrefix applies the HasPrefix predicate on the "HandleName" field. +// HandleNameHasPrefix applies the HasPrefix predicate on the "handle_name" field. func HandleNameHasPrefix(v string) predicate.User { return predicate.User(sql.FieldHasPrefix(FieldHandleName, v)) } -// HandleNameHasSuffix applies the HasSuffix predicate on the "HandleName" field. +// HandleNameHasSuffix applies the HasSuffix predicate on the "handle_name" field. func HandleNameHasSuffix(v string) predicate.User { return predicate.User(sql.FieldHasSuffix(FieldHandleName, v)) } -// HandleNameEqualFold applies the EqualFold predicate on the "HandleName" field. +// HandleNameEqualFold applies the EqualFold predicate on the "handle_name" field. func HandleNameEqualFold(v string) predicate.User { return predicate.User(sql.FieldEqualFold(FieldHandleName, v)) } -// HandleNameContainsFold applies the ContainsFold predicate on the "HandleName" field. +// HandleNameContainsFold applies the ContainsFold predicate on the "handle_name" field. func HandleNameContainsFold(v string) predicate.User { return predicate.User(sql.FieldContainsFold(FieldHandleName, v)) } diff --git a/typing-server/domain/repository/ent/user_create.go b/typing-server/domain/repository/ent/user_create.go index c2864ac..edae558 100644 --- a/typing-server/domain/repository/ent/user_create.go +++ b/typing-server/domain/repository/ent/user_create.go @@ -22,13 +22,13 @@ type UserCreate struct { hooks []Hook } -// SetStudentNumber sets the "StudentNumber" field. +// SetStudentNumber sets the "student_number" field. func (uc *UserCreate) SetStudentNumber(s string) *UserCreate { uc.mutation.SetStudentNumber(s) return uc } -// SetHandleName sets the "HandleName" field. +// SetHandleName sets the "handle_name" field. func (uc *UserCreate) SetHandleName(s string) *UserCreate { uc.mutation.SetHandleName(s) return uc @@ -143,19 +143,19 @@ func (uc *UserCreate) defaults() { // check runs all checks and user-defined validators on the builder. func (uc *UserCreate) check() error { if _, ok := uc.mutation.StudentNumber(); !ok { - return &ValidationError{Name: "StudentNumber", err: errors.New(`ent: missing required field "User.StudentNumber"`)} + return &ValidationError{Name: "student_number", err: errors.New(`ent: missing required field "User.student_number"`)} } if v, ok := uc.mutation.StudentNumber(); ok { if err := user.StudentNumberValidator(v); err != nil { - return &ValidationError{Name: "StudentNumber", err: fmt.Errorf(`ent: validator failed for field "User.StudentNumber": %w`, err)} + return &ValidationError{Name: "student_number", err: fmt.Errorf(`ent: validator failed for field "User.student_number": %w`, err)} } } if _, ok := uc.mutation.HandleName(); !ok { - return &ValidationError{Name: "HandleName", err: errors.New(`ent: missing required field "User.HandleName"`)} + return &ValidationError{Name: "handle_name", err: errors.New(`ent: missing required field "User.handle_name"`)} } if v, ok := uc.mutation.HandleName(); ok { if err := user.HandleNameValidator(v); err != nil { - return &ValidationError{Name: "HandleName", err: fmt.Errorf(`ent: validator failed for field "User.HandleName": %w`, err)} + return &ValidationError{Name: "handle_name", err: fmt.Errorf(`ent: validator failed for field "User.handle_name": %w`, err)} } } if _, ok := uc.mutation.CreatedAt(); !ok { diff --git a/typing-server/domain/repository/ent/user_query.go b/typing-server/domain/repository/ent/user_query.go index c88c6f5..a5b89b7 100644 --- a/typing-server/domain/repository/ent/user_query.go +++ b/typing-server/domain/repository/ent/user_query.go @@ -299,7 +299,7 @@ func (uq *UserQuery) WithScores(opts ...func(*ScoreQuery)) *UserQuery { // Example: // // var v []struct { -// StudentNumber string `json:"StudentNumber,omitempty"` +// StudentNumber string `json:"student_number,omitempty"` // Count int `json:"count,omitempty"` // } // @@ -322,7 +322,7 @@ func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { // Example: // // var v []struct { -// StudentNumber string `json:"StudentNumber,omitempty"` +// StudentNumber string `json:"student_number,omitempty"` // } // // client.User.Query(). diff --git a/typing-server/domain/repository/ent/user_update.go b/typing-server/domain/repository/ent/user_update.go index 98f1d92..68c90b6 100644 --- a/typing-server/domain/repository/ent/user_update.go +++ b/typing-server/domain/repository/ent/user_update.go @@ -30,13 +30,13 @@ func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate { return uu } -// SetStudentNumber sets the "StudentNumber" field. +// SetStudentNumber sets the "student_number" field. func (uu *UserUpdate) SetStudentNumber(s string) *UserUpdate { uu.mutation.SetStudentNumber(s) return uu } -// SetNillableStudentNumber sets the "StudentNumber" field if the given value is not nil. +// SetNillableStudentNumber sets the "student_number" field if the given value is not nil. func (uu *UserUpdate) SetNillableStudentNumber(s *string) *UserUpdate { if s != nil { uu.SetStudentNumber(*s) @@ -44,13 +44,13 @@ func (uu *UserUpdate) SetNillableStudentNumber(s *string) *UserUpdate { return uu } -// SetHandleName sets the "HandleName" field. +// SetHandleName sets the "handle_name" field. func (uu *UserUpdate) SetHandleName(s string) *UserUpdate { uu.mutation.SetHandleName(s) return uu } -// SetNillableHandleName sets the "HandleName" field if the given value is not nil. +// SetNillableHandleName sets the "handle_name" field if the given value is not nil. func (uu *UserUpdate) SetNillableHandleName(s *string) *UserUpdate { if s != nil { uu.SetHandleName(*s) @@ -145,12 +145,12 @@ func (uu *UserUpdate) defaults() { func (uu *UserUpdate) check() error { if v, ok := uu.mutation.StudentNumber(); ok { if err := user.StudentNumberValidator(v); err != nil { - return &ValidationError{Name: "StudentNumber", err: fmt.Errorf(`ent: validator failed for field "User.StudentNumber": %w`, err)} + return &ValidationError{Name: "student_number", err: fmt.Errorf(`ent: validator failed for field "User.student_number": %w`, err)} } } if v, ok := uu.mutation.HandleName(); ok { if err := user.HandleNameValidator(v); err != nil { - return &ValidationError{Name: "HandleName", err: fmt.Errorf(`ent: validator failed for field "User.HandleName": %w`, err)} + return &ValidationError{Name: "handle_name", err: fmt.Errorf(`ent: validator failed for field "User.handle_name": %w`, err)} } } return nil @@ -242,13 +242,13 @@ type UserUpdateOne struct { mutation *UserMutation } -// SetStudentNumber sets the "StudentNumber" field. +// SetStudentNumber sets the "student_number" field. func (uuo *UserUpdateOne) SetStudentNumber(s string) *UserUpdateOne { uuo.mutation.SetStudentNumber(s) return uuo } -// SetNillableStudentNumber sets the "StudentNumber" field if the given value is not nil. +// SetNillableStudentNumber sets the "student_number" field if the given value is not nil. func (uuo *UserUpdateOne) SetNillableStudentNumber(s *string) *UserUpdateOne { if s != nil { uuo.SetStudentNumber(*s) @@ -256,13 +256,13 @@ func (uuo *UserUpdateOne) SetNillableStudentNumber(s *string) *UserUpdateOne { return uuo } -// SetHandleName sets the "HandleName" field. +// SetHandleName sets the "handle_name" field. func (uuo *UserUpdateOne) SetHandleName(s string) *UserUpdateOne { uuo.mutation.SetHandleName(s) return uuo } -// SetNillableHandleName sets the "HandleName" field if the given value is not nil. +// SetNillableHandleName sets the "handle_name" field if the given value is not nil. func (uuo *UserUpdateOne) SetNillableHandleName(s *string) *UserUpdateOne { if s != nil { uuo.SetHandleName(*s) @@ -370,12 +370,12 @@ func (uuo *UserUpdateOne) defaults() { func (uuo *UserUpdateOne) check() error { if v, ok := uuo.mutation.StudentNumber(); ok { if err := user.StudentNumberValidator(v); err != nil { - return &ValidationError{Name: "StudentNumber", err: fmt.Errorf(`ent: validator failed for field "User.StudentNumber": %w`, err)} + return &ValidationError{Name: "student_number", err: fmt.Errorf(`ent: validator failed for field "User.student_number": %w`, err)} } } if v, ok := uuo.mutation.HandleName(); ok { if err := user.HandleNameValidator(v); err != nil { - return &ValidationError{Name: "HandleName", err: fmt.Errorf(`ent: validator failed for field "User.HandleName": %w`, err)} + return &ValidationError{Name: "handle_name", err: fmt.Errorf(`ent: validator failed for field "User.handle_name": %w`, err)} } } return nil