add database backend (sqlite only for now)

This commit is contained in:
2021-07-11 20:02:12 +02:00
parent 9c8366372f
commit f14f9b706b
26 changed files with 6768 additions and 48 deletions

33
ent/schema/dbpackage.go Normal file
View File

@@ -0,0 +1,33 @@
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().Positive(),
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
}