[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
40
backend/ent/schema/contributorsociallink.go
Normal file
40
backend/ent/schema/contributorsociallink.go
Normal file
|
@ -0,0 +1,40 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// ContributorSocialLink holds the schema definition for the ContributorSocialLink entity.
|
||||
type ContributorSocialLink struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
// Fields of the ContributorSocialLink.
|
||||
func (ContributorSocialLink) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Enum("type").
|
||||
NamedValues(
|
||||
"TWITTER", "twitter",
|
||||
"FACEBOOK", "facebook",
|
||||
"INSTAGRAM", "instagram",
|
||||
"LINKEDIN", "linkedin",
|
||||
"GITHUB", "github",
|
||||
"WEBSITE", "website",
|
||||
),
|
||||
field.String("name").
|
||||
Optional(),
|
||||
field.String("value").
|
||||
NotEmpty(),
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the ContributorSocialLink.
|
||||
func (ContributorSocialLink) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("contributor", Contributor.Type).
|
||||
Ref("social_links").
|
||||
Unique(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue