Skip to content

Conversation

@wataameto
Copy link

modify text replace
mac/windows chrome browser

package schema

import (
    "entgo.io/ent"
    "entgo.io/ent/dialect"
    "entgo.io/ent/schema/field"
    "github.com/google/uuid"
)

// User holds the schema definition for the User entity.
type User struct {
	ent.Schema
}

// Fields of the User.
func (User) Fields() []ent.Field {
  return []ent.Field{
    field.UUID("id", uuid.UUID{}).Default(uuid.New),
    field.String("name").
        Default("unknown"),
    field.Time("birth_date").
      Optional().
      SchemaType(map[string]string{
        dialect.MySQL: "datetime",
      }),
  }
}

// Edges of the User.
func (User) Edges() []ent.Edge {
	return nil
}

before
スクリーンショット 2023-12-10 20 51 01
after
スクリーンショット 2023-12-10 20 52 03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant