forked from ALHP/ALHP.GO
Add database with background information for each pkgbase, for possible future use. A static status page is generated from the db. Currently includes: * sub-packages * build-time * build-duration * status (failed, latest, skipped, queued, building, build) * version (both from PKGBUILD and repo) * last checked Database is currently only used for informational purposes. Goal is to refactor many (expensive) methods to use the db instead of searching/parsing files. Reviewed-on: https://git.harting.dev/anonfunc/ALHP.GO/pulls/26 Co-authored-by: Giovanni Harting <539@idlegandalf.com> Co-committed-by: Giovanni Harting <539@idlegandalf.com>
34 lines
824 B
Go
34 lines
824 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// DbPackage holds the schema definition for the DbPackage entity.
|
|
type DbPackage struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the DbPackage.
|
|
func (DbPackage) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("pkgbase").NotEmpty().Immutable().Unique(),
|
|
field.Strings("packages").Optional(),
|
|
field.Int("status").Optional().Min(0),
|
|
field.String("skip_reason").Optional(),
|
|
field.String("repository").NotEmpty(),
|
|
field.String("march").NotEmpty(),
|
|
field.String("version").Optional(),
|
|
field.String("repo_version").Optional(),
|
|
field.Time("build_time").Optional(),
|
|
field.Uint64("build_duration").Positive().Optional(),
|
|
field.Time("updated").Optional(),
|
|
}
|
|
}
|
|
|
|
// Edges of the DbPackage.
|
|
func (DbPackage) Edges() []ent.Edge {
|
|
return nil
|
|
}
|