Add general queue

This commit is contained in:
Achim Rohn
2025-11-16 19:09:01 +01:00
parent ed7ee7e95c
commit bcc5c7493d
60 changed files with 5657 additions and 8506 deletions
+60
View File
@@ -0,0 +1,60 @@
// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// GeneralQueueColumns holds the columns for the "generalQueue" table.
GeneralQueueColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "name", Type: field.TypeString},
{Name: "payload", Type: field.TypeJSON},
{Name: "status", Type: field.TypeEnum, Enums: []string{"pending", "in_progress", "completed", "failed"}},
{Name: "number_of_tries", Type: field.TypeInt, Default: 0},
{Name: "max_retries", Type: field.TypeInt, Default: 3},
{Name: "error_message", Type: field.TypeString, Nullable: true},
{Name: "failure_payload", Type: field.TypeJSON, Nullable: true},
{Name: "result_payload", Type: field.TypeJSON, Nullable: true},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "processed_at", Type: field.TypeTime, Nullable: true},
}
// GeneralQueueTable holds the schema information for the "generalQueue" table.
GeneralQueueTable = &schema.Table{
Name: "generalQueue",
Columns: GeneralQueueColumns,
PrimaryKey: []*schema.Column{GeneralQueueColumns[0]},
}
// GeneralQueueStateColumns holds the columns for the "generalQueueState" table.
GeneralQueueStateColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "name", Type: field.TypeString, Unique: true},
{Name: "running", Type: field.TypeBool, Default: false},
{Name: "updated_at", Type: field.TypeTime},
}
// GeneralQueueStateTable holds the schema information for the "generalQueueState" table.
GeneralQueueStateTable = &schema.Table{
Name: "generalQueueState",
Columns: GeneralQueueStateColumns,
PrimaryKey: []*schema.Column{GeneralQueueStateColumns[0]},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
GeneralQueueTable,
GeneralQueueStateTable,
}
)
func init() {
GeneralQueueTable.Annotation = &entsql.Annotation{
Table: "generalQueue",
}
GeneralQueueStateTable.Annotation = &entsql.Annotation{
Table: "generalQueueState",
}
}