34 lines
649 B
Go
34 lines
649 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/entsql"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// 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.Int("id").Unique(),
|
|
field.String("serverid"),
|
|
field.String("userid"),
|
|
field.String("username"),
|
|
field.Int("xp").Default(0),
|
|
field.Int("level").Default(1),
|
|
field.Int("msgs").Default(0),
|
|
field.Time("created").Annotations(&entsql.Annotation{
|
|
Default: "CURRENT_TIMESTAMP",
|
|
}),
|
|
}
|
|
}
|
|
|
|
// Edges of the User.
|
|
func (User) Edges() []ent.Edge {
|
|
return nil
|
|
}
|