forked from mirrors/homebox
generate database schemas
This commit is contained in:
parent
4c76f6b367
commit
63cfeffc4d
70 changed files with 26933 additions and 1398 deletions
35
backend/ent/schema/location.go
Normal file
35
backend/ent/schema/location.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"github.com/hay-kot/content/backend/ent/schema/mixins"
|
||||
)
|
||||
|
||||
// Location holds the schema definition for the Location entity.
|
||||
type Location struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (Location) Mixin() []ent.Mixin {
|
||||
return []ent.Mixin{
|
||||
mixins.BaseMixin{},
|
||||
mixins.DetailsMixin{},
|
||||
}
|
||||
}
|
||||
|
||||
// Fields of the Location.
|
||||
func (Location) Fields() []ent.Field {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Edges of the Location.
|
||||
func (Location) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("group", Group.Type).
|
||||
Ref("locations").
|
||||
Unique().
|
||||
Required(),
|
||||
edge.To("items", Item.Type),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue