initial commit
This commit is contained in:
33
ent/schema/user.go
Normal file
33
ent/schema/user.go
Normal file
@@ -0,0 +1,33 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user