37 lines
746 B
Go
37 lines
746 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/entsql"
|
|
"entgo.io/ent/schema"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
type GeneralQueueState struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (GeneralQueueState) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("name").
|
|
Unique().
|
|
Immutable().
|
|
Comment("Name of the queue (e.g., 'email', 'notifications')"),
|
|
field.Bool("running").
|
|
Default(false).
|
|
Comment("Whether the queue is currently running"),
|
|
field.Time("updated_at").
|
|
Comment("Last time the state was updated"),
|
|
}
|
|
}
|
|
|
|
func (GeneralQueueState) Edges() []ent.Edge {
|
|
return nil
|
|
}
|
|
|
|
func (GeneralQueueState) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{
|
|
entsql.Annotation{Table: "generalQueueState"},
|
|
}
|
|
}
|