Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
227
collection_post.go1.43 kB
package schema import ( "entgo.io/ent" "entgo.io/ent/dialect/entsql" "entgo.io/ent/schema" "entgo.io/ent/schema/edge" "entgo.io/ent/schema/field" "entgo.io/ent/schema/index" "github.com/rs/xid" ) type CollectionPost struct { ent.Schema } func (CollectionPost) Mixin() []ent.Mixin { return []ent.Mixin{CreatedAt{}} } func (CollectionPost) Fields() []ent.Field { return []ent.Field{ field.String("collection_id"). MaxLen(20). NotEmpty(). GoType(xid.ID{}). DefaultFunc(func() xid.ID { return xid.New() }), field.String("post_id"). MaxLen(20). NotEmpty(). GoType(xid.ID{}). DefaultFunc(func() xid.ID { return xid.New() }), field.String("membership_type"). Default("normal"). Annotations( entsql.Default("normal"), ), } } func (CollectionPost) Edges() []ent.Edge { return []ent.Edge{ edge.To("collection", Collection.Type). Unique(). Required(). Field("collection_id"). Annotations(entsql.OnDelete(entsql.Cascade)), edge.To("post", Post.Type). Unique(). Required(). Field("post_id"). Annotations(entsql.OnDelete(entsql.Cascade)), } } func (CollectionPost) Indexes() []ent.Index { return []ent.Index{ index.Fields("collection_id", "post_id"). Unique(). StorageKey("unique_collection_post"), } } func (CollectionPost) Annotations() []schema.Annotation { return []schema.Annotation{ field.ID("collection_id", "post_id"), } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server