Skip to content

Commit

Permalink
feat: implement field diy modify (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r authored Jun 7, 2023
1 parent 7b1ba09 commit 16aa4cd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions field_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ import (
// ModelOpt field option
type ModelOpt = model.Option

// Field exported model.Field
type Field = *model.Field

var ns = schema.NamingStrategy{}

var (
FieldModify = func(opt func(Field) Field) model.ModifyFieldOpt {
return func(f *model.Field) *model.Field {
return opt(f)
}
}

// FieldNew add new field (any type your want)
FieldNew = func(fieldName, fieldType string, fieldTag field.Tag) model.CreateFieldOpt {
return func(*model.Field) *model.Field {
Expand Down

0 comments on commit 16aa4cd

Please sign in to comment.