Files
ersteller/schema/ent/schema/general_queue.go
T
2026-03-21 16:11:24 +00:00

35 lines
950 B
Go

package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
)
type GeneralQueue struct {
ent.Schema
}
func (GeneralQueue) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
field.JSON("payload", map[string]interface{}{}),
field.Enum("status").Values("pending", "in_progress", "completed", "failed"),
field.Int("number_of_tries").Default(0),
field.Int("max_retries").Default(3),
field.String("error_message").Optional(),
field.JSON("failure_payload", map[string]interface{}{}).Optional(),
field.JSON("result_payload", map[string]interface{}{}).Optional(),
field.Time("created_at"),
field.Time("updated_at"),
field.Time("processed_at").Optional(),
field.Int("user_id"),
field.String("workflow_id").Optional(),
}
}
func (GeneralQueue) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Annotation{Table: "generalQueue"}}
}