forked from ALHP/ALHP.GO
changes to db schema; more housekeeping work
This commit is contained in:
@@ -22,21 +22,21 @@ type DbPackage struct {
|
||||
// Packages holds the value of the "packages" field.
|
||||
Packages []string `json:"packages,omitempty"`
|
||||
// Status holds the value of the "status" field.
|
||||
Status int `json:"status,omitempty"`
|
||||
Status dbpackage.Status `json:"status,omitempty"`
|
||||
// SkipReason holds the value of the "skip_reason" field.
|
||||
SkipReason string `json:"skip_reason,omitempty"`
|
||||
// Repository holds the value of the "repository" field.
|
||||
Repository string `json:"repository,omitempty"`
|
||||
Repository dbpackage.Repository `json:"repository,omitempty"`
|
||||
// March holds the value of the "march" field.
|
||||
March string `json:"march,omitempty"`
|
||||
// Version holds the value of the "version" field.
|
||||
Version string `json:"version,omitempty"`
|
||||
// RepoVersion holds the value of the "repo_version" field.
|
||||
RepoVersion string `json:"repo_version,omitempty"`
|
||||
// BuildTime holds the value of the "build_time" field.
|
||||
BuildTime time.Time `json:"build_time,omitempty"`
|
||||
// BuildDuration holds the value of the "build_duration" field.
|
||||
BuildDuration uint64 `json:"build_duration,omitempty"`
|
||||
// BuildTimeStart holds the value of the "build_time_start" field.
|
||||
BuildTimeStart time.Time `json:"build_time_start,omitempty"`
|
||||
// BuildTimeEnd holds the value of the "build_time_end" field.
|
||||
BuildTimeEnd time.Time `json:"build_time_end,omitempty"`
|
||||
// Updated holds the value of the "updated" field.
|
||||
Updated time.Time `json:"updated,omitempty"`
|
||||
// Hash holds the value of the "hash" field.
|
||||
@@ -50,11 +50,11 @@ func (*DbPackage) scanValues(columns []string) ([]interface{}, error) {
|
||||
switch columns[i] {
|
||||
case dbpackage.FieldPackages:
|
||||
values[i] = new([]byte)
|
||||
case dbpackage.FieldID, dbpackage.FieldStatus, dbpackage.FieldBuildDuration:
|
||||
case dbpackage.FieldID:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case dbpackage.FieldPkgbase, dbpackage.FieldSkipReason, dbpackage.FieldRepository, dbpackage.FieldMarch, dbpackage.FieldVersion, dbpackage.FieldRepoVersion, dbpackage.FieldHash:
|
||||
case dbpackage.FieldPkgbase, dbpackage.FieldStatus, dbpackage.FieldSkipReason, dbpackage.FieldRepository, dbpackage.FieldMarch, dbpackage.FieldVersion, dbpackage.FieldRepoVersion, dbpackage.FieldHash:
|
||||
values[i] = new(sql.NullString)
|
||||
case dbpackage.FieldBuildTime, dbpackage.FieldUpdated:
|
||||
case dbpackage.FieldBuildTimeStart, dbpackage.FieldBuildTimeEnd, dbpackage.FieldUpdated:
|
||||
values[i] = new(sql.NullTime)
|
||||
default:
|
||||
return nil, fmt.Errorf("unexpected column %q for type DbPackage", columns[i])
|
||||
@@ -92,10 +92,10 @@ func (dp *DbPackage) assignValues(columns []string, values []interface{}) error
|
||||
}
|
||||
}
|
||||
case dbpackage.FieldStatus:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field status", values[i])
|
||||
} else if value.Valid {
|
||||
dp.Status = int(value.Int64)
|
||||
dp.Status = dbpackage.Status(value.String)
|
||||
}
|
||||
case dbpackage.FieldSkipReason:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
@@ -107,7 +107,7 @@ func (dp *DbPackage) assignValues(columns []string, values []interface{}) error
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field repository", values[i])
|
||||
} else if value.Valid {
|
||||
dp.Repository = value.String
|
||||
dp.Repository = dbpackage.Repository(value.String)
|
||||
}
|
||||
case dbpackage.FieldMarch:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
@@ -127,17 +127,17 @@ func (dp *DbPackage) assignValues(columns []string, values []interface{}) error
|
||||
} else if value.Valid {
|
||||
dp.RepoVersion = value.String
|
||||
}
|
||||
case dbpackage.FieldBuildTime:
|
||||
case dbpackage.FieldBuildTimeStart:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field build_time", values[i])
|
||||
return fmt.Errorf("unexpected type %T for field build_time_start", values[i])
|
||||
} else if value.Valid {
|
||||
dp.BuildTime = value.Time
|
||||
dp.BuildTimeStart = value.Time
|
||||
}
|
||||
case dbpackage.FieldBuildDuration:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field build_duration", values[i])
|
||||
case dbpackage.FieldBuildTimeEnd:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field build_time_end", values[i])
|
||||
} else if value.Valid {
|
||||
dp.BuildDuration = uint64(value.Int64)
|
||||
dp.BuildTimeEnd = value.Time
|
||||
}
|
||||
case dbpackage.FieldUpdated:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
@@ -188,17 +188,17 @@ func (dp *DbPackage) String() string {
|
||||
builder.WriteString(", skip_reason=")
|
||||
builder.WriteString(dp.SkipReason)
|
||||
builder.WriteString(", repository=")
|
||||
builder.WriteString(dp.Repository)
|
||||
builder.WriteString(fmt.Sprintf("%v", dp.Repository))
|
||||
builder.WriteString(", march=")
|
||||
builder.WriteString(dp.March)
|
||||
builder.WriteString(", version=")
|
||||
builder.WriteString(dp.Version)
|
||||
builder.WriteString(", repo_version=")
|
||||
builder.WriteString(dp.RepoVersion)
|
||||
builder.WriteString(", build_time=")
|
||||
builder.WriteString(dp.BuildTime.Format(time.ANSIC))
|
||||
builder.WriteString(", build_duration=")
|
||||
builder.WriteString(fmt.Sprintf("%v", dp.BuildDuration))
|
||||
builder.WriteString(", build_time_start=")
|
||||
builder.WriteString(dp.BuildTimeStart.Format(time.ANSIC))
|
||||
builder.WriteString(", build_time_end=")
|
||||
builder.WriteString(dp.BuildTimeEnd.Format(time.ANSIC))
|
||||
builder.WriteString(", updated=")
|
||||
builder.WriteString(dp.Updated.Format(time.ANSIC))
|
||||
builder.WriteString(", hash=")
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
package dbpackage
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the dbpackage type in the database.
|
||||
Label = "db_package"
|
||||
@@ -23,10 +27,10 @@ const (
|
||||
FieldVersion = "version"
|
||||
// FieldRepoVersion holds the string denoting the repo_version field in the database.
|
||||
FieldRepoVersion = "repo_version"
|
||||
// FieldBuildTime holds the string denoting the build_time field in the database.
|
||||
FieldBuildTime = "build_time"
|
||||
// FieldBuildDuration holds the string denoting the build_duration field in the database.
|
||||
FieldBuildDuration = "build_duration"
|
||||
// FieldBuildTimeStart holds the string denoting the build_time_start field in the database.
|
||||
FieldBuildTimeStart = "build_time_start"
|
||||
// FieldBuildTimeEnd holds the string denoting the build_time_end field in the database.
|
||||
FieldBuildTimeEnd = "build_time_end"
|
||||
// FieldUpdated holds the string denoting the updated field in the database.
|
||||
FieldUpdated = "updated"
|
||||
// FieldHash holds the string denoting the hash field in the database.
|
||||
@@ -46,8 +50,8 @@ var Columns = []string{
|
||||
FieldMarch,
|
||||
FieldVersion,
|
||||
FieldRepoVersion,
|
||||
FieldBuildTime,
|
||||
FieldBuildDuration,
|
||||
FieldBuildTimeStart,
|
||||
FieldBuildTimeEnd,
|
||||
FieldUpdated,
|
||||
FieldHash,
|
||||
}
|
||||
@@ -65,14 +69,62 @@ func ValidColumn(column string) bool {
|
||||
var (
|
||||
// PkgbaseValidator is a validator for the "pkgbase" field. It is called by the builders before save.
|
||||
PkgbaseValidator func(string) error
|
||||
// DefaultStatus holds the default value on creation for the "status" field.
|
||||
DefaultStatus int
|
||||
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
StatusValidator func(int) error
|
||||
// RepositoryValidator is a validator for the "repository" field. It is called by the builders before save.
|
||||
RepositoryValidator func(string) error
|
||||
// MarchValidator is a validator for the "march" field. It is called by the builders before save.
|
||||
MarchValidator func(string) error
|
||||
// BuildDurationValidator is a validator for the "build_duration" field. It is called by the builders before save.
|
||||
BuildDurationValidator func(uint64) error
|
||||
)
|
||||
|
||||
// Status defines the type for the "status" enum field.
|
||||
type Status string
|
||||
|
||||
// StatusUnknown is the default value of the Status enum.
|
||||
const DefaultStatus = StatusUnknown
|
||||
|
||||
// Status values.
|
||||
const (
|
||||
StatusSkipped Status = "skipped"
|
||||
StatusFailed Status = "failed"
|
||||
StatusBuild Status = "build"
|
||||
StatusQueued Status = "queued"
|
||||
StatusBuilding Status = "building"
|
||||
StatusLatest Status = "latest"
|
||||
StatusSigning Status = "signing"
|
||||
StatusUnknown Status = "unknown"
|
||||
)
|
||||
|
||||
func (s Status) String() string {
|
||||
return string(s)
|
||||
}
|
||||
|
||||
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
|
||||
func StatusValidator(s Status) error {
|
||||
switch s {
|
||||
case StatusSkipped, StatusFailed, StatusBuild, StatusQueued, StatusBuilding, StatusLatest, StatusSigning, StatusUnknown:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("dbpackage: invalid enum value for status field: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// Repository defines the type for the "repository" enum field.
|
||||
type Repository string
|
||||
|
||||
// Repository values.
|
||||
const (
|
||||
RepositoryExtra Repository = "extra"
|
||||
RepositoryCore Repository = "core"
|
||||
RepositoryCommunity Repository = "community"
|
||||
)
|
||||
|
||||
func (r Repository) String() string {
|
||||
return string(r)
|
||||
}
|
||||
|
||||
// RepositoryValidator is a validator for the "repository" field enum values. It is called by the builders before save.
|
||||
func RepositoryValidator(r Repository) error {
|
||||
switch r {
|
||||
case RepositoryExtra, RepositoryCore, RepositoryCommunity:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("dbpackage: invalid enum value for repository field: %q", r)
|
||||
}
|
||||
}
|
||||
|
@@ -99,13 +99,6 @@ func Pkgbase(v string) predicate.DbPackage {
|
||||
})
|
||||
}
|
||||
|
||||
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
|
||||
func Status(v int) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldStatus), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SkipReason applies equality check predicate on the "skip_reason" field. It's identical to SkipReasonEQ.
|
||||
func SkipReason(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
@@ -113,13 +106,6 @@ func SkipReason(v string) predicate.DbPackage {
|
||||
})
|
||||
}
|
||||
|
||||
// Repository applies equality check predicate on the "repository" field. It's identical to RepositoryEQ.
|
||||
func Repository(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// March applies equality check predicate on the "march" field. It's identical to MarchEQ.
|
||||
func March(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
@@ -141,17 +127,17 @@ func RepoVersion(v string) predicate.DbPackage {
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTime applies equality check predicate on the "build_time" field. It's identical to BuildTimeEQ.
|
||||
func BuildTime(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStart applies equality check predicate on the "build_time_start" field. It's identical to BuildTimeStartEQ.
|
||||
func BuildTimeStart(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.EQ(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDuration applies equality check predicate on the "build_duration" field. It's identical to BuildDurationEQ.
|
||||
func BuildDuration(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEnd applies equality check predicate on the "build_time_end" field. It's identical to BuildTimeEndEQ.
|
||||
func BuildTimeEnd(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.EQ(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -295,21 +281,21 @@ func PackagesNotNil() predicate.DbPackage {
|
||||
}
|
||||
|
||||
// StatusEQ applies the EQ predicate on the "status" field.
|
||||
func StatusEQ(v int) predicate.DbPackage {
|
||||
func StatusEQ(v Status) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldStatus), v))
|
||||
})
|
||||
}
|
||||
|
||||
// StatusNEQ applies the NEQ predicate on the "status" field.
|
||||
func StatusNEQ(v int) predicate.DbPackage {
|
||||
func StatusNEQ(v Status) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldStatus), v))
|
||||
})
|
||||
}
|
||||
|
||||
// StatusIn applies the In predicate on the "status" field.
|
||||
func StatusIn(vs ...int) predicate.DbPackage {
|
||||
func StatusIn(vs ...Status) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -326,7 +312,7 @@ func StatusIn(vs ...int) predicate.DbPackage {
|
||||
}
|
||||
|
||||
// StatusNotIn applies the NotIn predicate on the "status" field.
|
||||
func StatusNotIn(vs ...int) predicate.DbPackage {
|
||||
func StatusNotIn(vs ...Status) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -342,31 +328,17 @@ func StatusNotIn(vs ...int) predicate.DbPackage {
|
||||
})
|
||||
}
|
||||
|
||||
// StatusGT applies the GT predicate on the "status" field.
|
||||
func StatusGT(v int) predicate.DbPackage {
|
||||
// StatusIsNil applies the IsNil predicate on the "status" field.
|
||||
func StatusIsNil() predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldStatus), v))
|
||||
s.Where(sql.IsNull(s.C(FieldStatus)))
|
||||
})
|
||||
}
|
||||
|
||||
// StatusGTE applies the GTE predicate on the "status" field.
|
||||
func StatusGTE(v int) predicate.DbPackage {
|
||||
// StatusNotNil applies the NotNil predicate on the "status" field.
|
||||
func StatusNotNil() predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldStatus), v))
|
||||
})
|
||||
}
|
||||
|
||||
// StatusLT applies the LT predicate on the "status" field.
|
||||
func StatusLT(v int) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldStatus), v))
|
||||
})
|
||||
}
|
||||
|
||||
// StatusLTE applies the LTE predicate on the "status" field.
|
||||
func StatusLTE(v int) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldStatus), v))
|
||||
s.Where(sql.NotNull(s.C(FieldStatus)))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -496,21 +468,21 @@ func SkipReasonContainsFold(v string) predicate.DbPackage {
|
||||
}
|
||||
|
||||
// RepositoryEQ applies the EQ predicate on the "repository" field.
|
||||
func RepositoryEQ(v string) predicate.DbPackage {
|
||||
func RepositoryEQ(v Repository) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryNEQ applies the NEQ predicate on the "repository" field.
|
||||
func RepositoryNEQ(v string) predicate.DbPackage {
|
||||
func RepositoryNEQ(v Repository) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryIn applies the In predicate on the "repository" field.
|
||||
func RepositoryIn(vs ...string) predicate.DbPackage {
|
||||
func RepositoryIn(vs ...Repository) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -527,7 +499,7 @@ func RepositoryIn(vs ...string) predicate.DbPackage {
|
||||
}
|
||||
|
||||
// RepositoryNotIn applies the NotIn predicate on the "repository" field.
|
||||
func RepositoryNotIn(vs ...string) predicate.DbPackage {
|
||||
func RepositoryNotIn(vs ...Repository) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -543,69 +515,6 @@ func RepositoryNotIn(vs ...string) predicate.DbPackage {
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryGT applies the GT predicate on the "repository" field.
|
||||
func RepositoryGT(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryGTE applies the GTE predicate on the "repository" field.
|
||||
func RepositoryGTE(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryLT applies the LT predicate on the "repository" field.
|
||||
func RepositoryLT(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryLTE applies the LTE predicate on the "repository" field.
|
||||
func RepositoryLTE(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryContains applies the Contains predicate on the "repository" field.
|
||||
func RepositoryContains(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.Contains(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryHasPrefix applies the HasPrefix predicate on the "repository" field.
|
||||
func RepositoryHasPrefix(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.HasPrefix(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryHasSuffix applies the HasSuffix predicate on the "repository" field.
|
||||
func RepositoryHasSuffix(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.HasSuffix(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryEqualFold applies the EqualFold predicate on the "repository" field.
|
||||
func RepositoryEqualFold(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EqualFold(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// RepositoryContainsFold applies the ContainsFold predicate on the "repository" field.
|
||||
func RepositoryContainsFold(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.ContainsFold(s.C(FieldRepository), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MarchEQ applies the EQ predicate on the "march" field.
|
||||
func MarchEQ(v string) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
@@ -967,22 +876,22 @@ func RepoVersionContainsFold(v string) predicate.DbPackage {
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeEQ applies the EQ predicate on the "build_time" field.
|
||||
func BuildTimeEQ(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartEQ applies the EQ predicate on the "build_time_start" field.
|
||||
func BuildTimeStartEQ(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.EQ(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeNEQ applies the NEQ predicate on the "build_time" field.
|
||||
func BuildTimeNEQ(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartNEQ applies the NEQ predicate on the "build_time_start" field.
|
||||
func BuildTimeStartNEQ(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.NEQ(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeIn applies the In predicate on the "build_time" field.
|
||||
func BuildTimeIn(vs ...time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartIn applies the In predicate on the "build_time_start" field.
|
||||
func BuildTimeStartIn(vs ...time.Time) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -994,12 +903,12 @@ func BuildTimeIn(vs ...time.Time) predicate.DbPackage {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldBuildTime), v...))
|
||||
s.Where(sql.In(s.C(FieldBuildTimeStart), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeNotIn applies the NotIn predicate on the "build_time" field.
|
||||
func BuildTimeNotIn(vs ...time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartNotIn applies the NotIn predicate on the "build_time_start" field.
|
||||
func BuildTimeStartNotIn(vs ...time.Time) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -1011,68 +920,68 @@ func BuildTimeNotIn(vs ...time.Time) predicate.DbPackage {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldBuildTime), v...))
|
||||
s.Where(sql.NotIn(s.C(FieldBuildTimeStart), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeGT applies the GT predicate on the "build_time" field.
|
||||
func BuildTimeGT(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartGT applies the GT predicate on the "build_time_start" field.
|
||||
func BuildTimeStartGT(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.GT(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeGTE applies the GTE predicate on the "build_time" field.
|
||||
func BuildTimeGTE(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartGTE applies the GTE predicate on the "build_time_start" field.
|
||||
func BuildTimeStartGTE(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.GTE(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeLT applies the LT predicate on the "build_time" field.
|
||||
func BuildTimeLT(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartLT applies the LT predicate on the "build_time_start" field.
|
||||
func BuildTimeStartLT(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.LT(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeLTE applies the LTE predicate on the "build_time" field.
|
||||
func BuildTimeLTE(v time.Time) predicate.DbPackage {
|
||||
// BuildTimeStartLTE applies the LTE predicate on the "build_time_start" field.
|
||||
func BuildTimeStartLTE(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldBuildTime), v))
|
||||
s.Where(sql.LTE(s.C(FieldBuildTimeStart), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeIsNil applies the IsNil predicate on the "build_time" field.
|
||||
func BuildTimeIsNil() predicate.DbPackage {
|
||||
// BuildTimeStartIsNil applies the IsNil predicate on the "build_time_start" field.
|
||||
func BuildTimeStartIsNil() predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldBuildTime)))
|
||||
s.Where(sql.IsNull(s.C(FieldBuildTimeStart)))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildTimeNotNil applies the NotNil predicate on the "build_time" field.
|
||||
func BuildTimeNotNil() predicate.DbPackage {
|
||||
// BuildTimeStartNotNil applies the NotNil predicate on the "build_time_start" field.
|
||||
func BuildTimeStartNotNil() predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldBuildTime)))
|
||||
s.Where(sql.NotNull(s.C(FieldBuildTimeStart)))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationEQ applies the EQ predicate on the "build_duration" field.
|
||||
func BuildDurationEQ(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEndEQ applies the EQ predicate on the "build_time_end" field.
|
||||
func BuildTimeEndEQ(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.EQ(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationNEQ applies the NEQ predicate on the "build_duration" field.
|
||||
func BuildDurationNEQ(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEndNEQ applies the NEQ predicate on the "build_time_end" field.
|
||||
func BuildTimeEndNEQ(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.NEQ(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationIn applies the In predicate on the "build_duration" field.
|
||||
func BuildDurationIn(vs ...uint64) predicate.DbPackage {
|
||||
// BuildTimeEndIn applies the In predicate on the "build_time_end" field.
|
||||
func BuildTimeEndIn(vs ...time.Time) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -1084,12 +993,12 @@ func BuildDurationIn(vs ...uint64) predicate.DbPackage {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldBuildDuration), v...))
|
||||
s.Where(sql.In(s.C(FieldBuildTimeEnd), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationNotIn applies the NotIn predicate on the "build_duration" field.
|
||||
func BuildDurationNotIn(vs ...uint64) predicate.DbPackage {
|
||||
// BuildTimeEndNotIn applies the NotIn predicate on the "build_time_end" field.
|
||||
func BuildTimeEndNotIn(vs ...time.Time) predicate.DbPackage {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
@@ -1101,49 +1010,49 @@ func BuildDurationNotIn(vs ...uint64) predicate.DbPackage {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldBuildDuration), v...))
|
||||
s.Where(sql.NotIn(s.C(FieldBuildTimeEnd), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationGT applies the GT predicate on the "build_duration" field.
|
||||
func BuildDurationGT(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEndGT applies the GT predicate on the "build_time_end" field.
|
||||
func BuildTimeEndGT(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.GT(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationGTE applies the GTE predicate on the "build_duration" field.
|
||||
func BuildDurationGTE(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEndGTE applies the GTE predicate on the "build_time_end" field.
|
||||
func BuildTimeEndGTE(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.GTE(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationLT applies the LT predicate on the "build_duration" field.
|
||||
func BuildDurationLT(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEndLT applies the LT predicate on the "build_time_end" field.
|
||||
func BuildTimeEndLT(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.LT(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationLTE applies the LTE predicate on the "build_duration" field.
|
||||
func BuildDurationLTE(v uint64) predicate.DbPackage {
|
||||
// BuildTimeEndLTE applies the LTE predicate on the "build_time_end" field.
|
||||
func BuildTimeEndLTE(v time.Time) predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldBuildDuration), v))
|
||||
s.Where(sql.LTE(s.C(FieldBuildTimeEnd), v))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationIsNil applies the IsNil predicate on the "build_duration" field.
|
||||
func BuildDurationIsNil() predicate.DbPackage {
|
||||
// BuildTimeEndIsNil applies the IsNil predicate on the "build_time_end" field.
|
||||
func BuildTimeEndIsNil() predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldBuildDuration)))
|
||||
s.Where(sql.IsNull(s.C(FieldBuildTimeEnd)))
|
||||
})
|
||||
}
|
||||
|
||||
// BuildDurationNotNil applies the NotNil predicate on the "build_duration" field.
|
||||
func BuildDurationNotNil() predicate.DbPackage {
|
||||
// BuildTimeEndNotNil applies the NotNil predicate on the "build_time_end" field.
|
||||
func BuildTimeEndNotNil() predicate.DbPackage {
|
||||
return predicate.DbPackage(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldBuildDuration)))
|
||||
s.Where(sql.NotNull(s.C(FieldBuildTimeEnd)))
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -33,15 +33,15 @@ func (dpc *DbPackageCreate) SetPackages(s []string) *DbPackageCreate {
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (dpc *DbPackageCreate) SetStatus(i int) *DbPackageCreate {
|
||||
dpc.mutation.SetStatus(i)
|
||||
func (dpc *DbPackageCreate) SetStatus(d dbpackage.Status) *DbPackageCreate {
|
||||
dpc.mutation.SetStatus(d)
|
||||
return dpc
|
||||
}
|
||||
|
||||
// SetNillableStatus sets the "status" field if the given value is not nil.
|
||||
func (dpc *DbPackageCreate) SetNillableStatus(i *int) *DbPackageCreate {
|
||||
if i != nil {
|
||||
dpc.SetStatus(*i)
|
||||
func (dpc *DbPackageCreate) SetNillableStatus(d *dbpackage.Status) *DbPackageCreate {
|
||||
if d != nil {
|
||||
dpc.SetStatus(*d)
|
||||
}
|
||||
return dpc
|
||||
}
|
||||
@@ -61,8 +61,8 @@ func (dpc *DbPackageCreate) SetNillableSkipReason(s *string) *DbPackageCreate {
|
||||
}
|
||||
|
||||
// SetRepository sets the "repository" field.
|
||||
func (dpc *DbPackageCreate) SetRepository(s string) *DbPackageCreate {
|
||||
dpc.mutation.SetRepository(s)
|
||||
func (dpc *DbPackageCreate) SetRepository(d dbpackage.Repository) *DbPackageCreate {
|
||||
dpc.mutation.SetRepository(d)
|
||||
return dpc
|
||||
}
|
||||
|
||||
@@ -100,30 +100,30 @@ func (dpc *DbPackageCreate) SetNillableRepoVersion(s *string) *DbPackageCreate {
|
||||
return dpc
|
||||
}
|
||||
|
||||
// SetBuildTime sets the "build_time" field.
|
||||
func (dpc *DbPackageCreate) SetBuildTime(t time.Time) *DbPackageCreate {
|
||||
dpc.mutation.SetBuildTime(t)
|
||||
// SetBuildTimeStart sets the "build_time_start" field.
|
||||
func (dpc *DbPackageCreate) SetBuildTimeStart(t time.Time) *DbPackageCreate {
|
||||
dpc.mutation.SetBuildTimeStart(t)
|
||||
return dpc
|
||||
}
|
||||
|
||||
// SetNillableBuildTime sets the "build_time" field if the given value is not nil.
|
||||
func (dpc *DbPackageCreate) SetNillableBuildTime(t *time.Time) *DbPackageCreate {
|
||||
// SetNillableBuildTimeStart sets the "build_time_start" field if the given value is not nil.
|
||||
func (dpc *DbPackageCreate) SetNillableBuildTimeStart(t *time.Time) *DbPackageCreate {
|
||||
if t != nil {
|
||||
dpc.SetBuildTime(*t)
|
||||
dpc.SetBuildTimeStart(*t)
|
||||
}
|
||||
return dpc
|
||||
}
|
||||
|
||||
// SetBuildDuration sets the "build_duration" field.
|
||||
func (dpc *DbPackageCreate) SetBuildDuration(u uint64) *DbPackageCreate {
|
||||
dpc.mutation.SetBuildDuration(u)
|
||||
// SetBuildTimeEnd sets the "build_time_end" field.
|
||||
func (dpc *DbPackageCreate) SetBuildTimeEnd(t time.Time) *DbPackageCreate {
|
||||
dpc.mutation.SetBuildTimeEnd(t)
|
||||
return dpc
|
||||
}
|
||||
|
||||
// SetNillableBuildDuration sets the "build_duration" field if the given value is not nil.
|
||||
func (dpc *DbPackageCreate) SetNillableBuildDuration(u *uint64) *DbPackageCreate {
|
||||
if u != nil {
|
||||
dpc.SetBuildDuration(*u)
|
||||
// SetNillableBuildTimeEnd sets the "build_time_end" field if the given value is not nil.
|
||||
func (dpc *DbPackageCreate) SetNillableBuildTimeEnd(t *time.Time) *DbPackageCreate {
|
||||
if t != nil {
|
||||
dpc.SetBuildTimeEnd(*t)
|
||||
}
|
||||
return dpc
|
||||
}
|
||||
@@ -243,9 +243,6 @@ func (dpc *DbPackageCreate) check() error {
|
||||
return &ValidationError{Name: "pkgbase", err: fmt.Errorf(`ent: validator failed for field "pkgbase": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := dpc.mutation.Status(); !ok {
|
||||
return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "status"`)}
|
||||
}
|
||||
if v, ok := dpc.mutation.Status(); ok {
|
||||
if err := dbpackage.StatusValidator(v); err != nil {
|
||||
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "status": %w`, err)}
|
||||
@@ -267,11 +264,6 @@ func (dpc *DbPackageCreate) check() error {
|
||||
return &ValidationError{Name: "march", err: fmt.Errorf(`ent: validator failed for field "march": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := dpc.mutation.BuildDuration(); ok {
|
||||
if err := dbpackage.BuildDurationValidator(v); err != nil {
|
||||
return &ValidationError{Name: "build_duration", err: fmt.Errorf(`ent: validator failed for field "build_duration": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -317,7 +309,7 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
if value, ok := dpc.mutation.Status(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
@@ -333,7 +325,7 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
if value, ok := dpc.mutation.Repository(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepository,
|
||||
})
|
||||
@@ -363,21 +355,21 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
|
||||
})
|
||||
_node.RepoVersion = value
|
||||
}
|
||||
if value, ok := dpc.mutation.BuildTime(); ok {
|
||||
if value, ok := dpc.mutation.BuildTimeStart(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
_node.BuildTime = value
|
||||
_node.BuildTimeStart = value
|
||||
}
|
||||
if value, ok := dpc.mutation.BuildDuration(); ok {
|
||||
if value, ok := dpc.mutation.BuildTimeEnd(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
Column: dbpackage.FieldBuildTimeEnd,
|
||||
})
|
||||
_node.BuildDuration = value
|
||||
_node.BuildTimeEnd = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Updated(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
|
@@ -24,6 +24,7 @@ type DbPackageQuery struct {
|
||||
order []OrderFunc
|
||||
fields []string
|
||||
predicates []predicate.DbPackage
|
||||
modifiers []func(s *sql.Selector)
|
||||
// intermediate query (i.e. traversal path).
|
||||
sql *sql.Selector
|
||||
path func(context.Context) (*sql.Selector, error)
|
||||
@@ -325,6 +326,9 @@ func (dpq *DbPackageQuery) sqlAll(ctx context.Context) ([]*DbPackage, error) {
|
||||
node := nodes[len(nodes)-1]
|
||||
return node.assignValues(columns, values)
|
||||
}
|
||||
if len(dpq.modifiers) > 0 {
|
||||
_spec.Modifiers = dpq.modifiers
|
||||
}
|
||||
if err := sqlgraph.QueryNodes(ctx, dpq.driver, _spec); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -336,6 +340,9 @@ func (dpq *DbPackageQuery) sqlAll(ctx context.Context) ([]*DbPackage, error) {
|
||||
|
||||
func (dpq *DbPackageQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
_spec := dpq.querySpec()
|
||||
if len(dpq.modifiers) > 0 {
|
||||
_spec.Modifiers = dpq.modifiers
|
||||
}
|
||||
return sqlgraph.CountNodes(ctx, dpq.driver, _spec)
|
||||
}
|
||||
|
||||
@@ -407,6 +414,9 @@ func (dpq *DbPackageQuery) sqlQuery(ctx context.Context) *sql.Selector {
|
||||
selector = dpq.sql
|
||||
selector.Select(selector.Columns(columns...)...)
|
||||
}
|
||||
for _, m := range dpq.modifiers {
|
||||
m(selector)
|
||||
}
|
||||
for _, p := range dpq.predicates {
|
||||
p(selector)
|
||||
}
|
||||
@@ -424,6 +434,12 @@ func (dpq *DbPackageQuery) sqlQuery(ctx context.Context) *sql.Selector {
|
||||
return selector
|
||||
}
|
||||
|
||||
// Modify adds a query modifier for attaching custom logic to queries.
|
||||
func (dpq *DbPackageQuery) Modify(modifiers ...func(s *sql.Selector)) *DbPackageSelect {
|
||||
dpq.modifiers = append(dpq.modifiers, modifiers...)
|
||||
return dpq.Select()
|
||||
}
|
||||
|
||||
// DbPackageGroupBy is the group-by builder for DbPackage entities.
|
||||
type DbPackageGroupBy struct {
|
||||
config
|
||||
@@ -913,3 +929,9 @@ func (dps *DbPackageSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
defer rows.Close()
|
||||
return sql.ScanSlice(rows, v)
|
||||
}
|
||||
|
||||
// Modify adds a query modifier for attaching custom logic to queries.
|
||||
func (dps *DbPackageSelect) Modify(modifiers ...func(s *sql.Selector)) *DbPackageSelect {
|
||||
dps.modifiers = append(dps.modifiers, modifiers...)
|
||||
return dps
|
||||
}
|
||||
|
@@ -40,23 +40,22 @@ func (dpu *DbPackageUpdate) ClearPackages() *DbPackageUpdate {
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (dpu *DbPackageUpdate) SetStatus(i int) *DbPackageUpdate {
|
||||
dpu.mutation.ResetStatus()
|
||||
dpu.mutation.SetStatus(i)
|
||||
func (dpu *DbPackageUpdate) SetStatus(d dbpackage.Status) *DbPackageUpdate {
|
||||
dpu.mutation.SetStatus(d)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetNillableStatus sets the "status" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableStatus(i *int) *DbPackageUpdate {
|
||||
if i != nil {
|
||||
dpu.SetStatus(*i)
|
||||
func (dpu *DbPackageUpdate) SetNillableStatus(d *dbpackage.Status) *DbPackageUpdate {
|
||||
if d != nil {
|
||||
dpu.SetStatus(*d)
|
||||
}
|
||||
return dpu
|
||||
}
|
||||
|
||||
// AddStatus adds i to the "status" field.
|
||||
func (dpu *DbPackageUpdate) AddStatus(i int) *DbPackageUpdate {
|
||||
dpu.mutation.AddStatus(i)
|
||||
// ClearStatus clears the value of the "status" field.
|
||||
func (dpu *DbPackageUpdate) ClearStatus() *DbPackageUpdate {
|
||||
dpu.mutation.ClearStatus()
|
||||
return dpu
|
||||
}
|
||||
|
||||
@@ -81,8 +80,8 @@ func (dpu *DbPackageUpdate) ClearSkipReason() *DbPackageUpdate {
|
||||
}
|
||||
|
||||
// SetRepository sets the "repository" field.
|
||||
func (dpu *DbPackageUpdate) SetRepository(s string) *DbPackageUpdate {
|
||||
dpu.mutation.SetRepository(s)
|
||||
func (dpu *DbPackageUpdate) SetRepository(d dbpackage.Repository) *DbPackageUpdate {
|
||||
dpu.mutation.SetRepository(d)
|
||||
return dpu
|
||||
}
|
||||
|
||||
@@ -132,50 +131,43 @@ func (dpu *DbPackageUpdate) ClearRepoVersion() *DbPackageUpdate {
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetBuildTime sets the "build_time" field.
|
||||
func (dpu *DbPackageUpdate) SetBuildTime(t time.Time) *DbPackageUpdate {
|
||||
dpu.mutation.SetBuildTime(t)
|
||||
// SetBuildTimeStart sets the "build_time_start" field.
|
||||
func (dpu *DbPackageUpdate) SetBuildTimeStart(t time.Time) *DbPackageUpdate {
|
||||
dpu.mutation.SetBuildTimeStart(t)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetNillableBuildTime sets the "build_time" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableBuildTime(t *time.Time) *DbPackageUpdate {
|
||||
// SetNillableBuildTimeStart sets the "build_time_start" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableBuildTimeStart(t *time.Time) *DbPackageUpdate {
|
||||
if t != nil {
|
||||
dpu.SetBuildTime(*t)
|
||||
dpu.SetBuildTimeStart(*t)
|
||||
}
|
||||
return dpu
|
||||
}
|
||||
|
||||
// ClearBuildTime clears the value of the "build_time" field.
|
||||
func (dpu *DbPackageUpdate) ClearBuildTime() *DbPackageUpdate {
|
||||
dpu.mutation.ClearBuildTime()
|
||||
// ClearBuildTimeStart clears the value of the "build_time_start" field.
|
||||
func (dpu *DbPackageUpdate) ClearBuildTimeStart() *DbPackageUpdate {
|
||||
dpu.mutation.ClearBuildTimeStart()
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetBuildDuration sets the "build_duration" field.
|
||||
func (dpu *DbPackageUpdate) SetBuildDuration(u uint64) *DbPackageUpdate {
|
||||
dpu.mutation.ResetBuildDuration()
|
||||
dpu.mutation.SetBuildDuration(u)
|
||||
// SetBuildTimeEnd sets the "build_time_end" field.
|
||||
func (dpu *DbPackageUpdate) SetBuildTimeEnd(t time.Time) *DbPackageUpdate {
|
||||
dpu.mutation.SetBuildTimeEnd(t)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// SetNillableBuildDuration sets the "build_duration" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableBuildDuration(u *uint64) *DbPackageUpdate {
|
||||
if u != nil {
|
||||
dpu.SetBuildDuration(*u)
|
||||
// SetNillableBuildTimeEnd sets the "build_time_end" field if the given value is not nil.
|
||||
func (dpu *DbPackageUpdate) SetNillableBuildTimeEnd(t *time.Time) *DbPackageUpdate {
|
||||
if t != nil {
|
||||
dpu.SetBuildTimeEnd(*t)
|
||||
}
|
||||
return dpu
|
||||
}
|
||||
|
||||
// AddBuildDuration adds u to the "build_duration" field.
|
||||
func (dpu *DbPackageUpdate) AddBuildDuration(u uint64) *DbPackageUpdate {
|
||||
dpu.mutation.AddBuildDuration(u)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// ClearBuildDuration clears the value of the "build_duration" field.
|
||||
func (dpu *DbPackageUpdate) ClearBuildDuration() *DbPackageUpdate {
|
||||
dpu.mutation.ClearBuildDuration()
|
||||
// ClearBuildTimeEnd clears the value of the "build_time_end" field.
|
||||
func (dpu *DbPackageUpdate) ClearBuildTimeEnd() *DbPackageUpdate {
|
||||
dpu.mutation.ClearBuildTimeEnd()
|
||||
return dpu
|
||||
}
|
||||
|
||||
@@ -301,11 +293,6 @@ func (dpu *DbPackageUpdate) check() error {
|
||||
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
|
||||
}
|
||||
}
|
||||
if v, ok := dpu.mutation.BuildDuration(); ok {
|
||||
if err := dbpackage.BuildDurationValidator(v); err != nil {
|
||||
return &ValidationError{Name: "build_duration", err: fmt.Errorf("ent: validator failed for field \"build_duration\": %w", err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -342,15 +329,14 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
if value, ok := dpu.mutation.Status(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedStatus(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
if dpu.mutation.StatusCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
}
|
||||
@@ -369,7 +355,7 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
if value, ok := dpu.mutation.Repository(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepository,
|
||||
})
|
||||
@@ -407,37 +393,30 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.BuildTime(); ok {
|
||||
if value, ok := dpu.mutation.BuildTimeStart(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
}
|
||||
if dpu.mutation.BuildTimeCleared() {
|
||||
if dpu.mutation.BuildTimeStartCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldBuildTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.BuildDuration(); ok {
|
||||
if value, ok := dpu.mutation.BuildTimeEnd(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
Column: dbpackage.FieldBuildTimeEnd,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedBuildDuration(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
})
|
||||
}
|
||||
if dpu.mutation.BuildDurationCleared() {
|
||||
if dpu.mutation.BuildTimeEndCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldBuildTimeEnd,
|
||||
})
|
||||
}
|
||||
if value, ok := dpu.mutation.Updated(); ok {
|
||||
@@ -498,23 +477,22 @@ func (dpuo *DbPackageUpdateOne) ClearPackages() *DbPackageUpdateOne {
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetStatus(i int) *DbPackageUpdateOne {
|
||||
dpuo.mutation.ResetStatus()
|
||||
dpuo.mutation.SetStatus(i)
|
||||
func (dpuo *DbPackageUpdateOne) SetStatus(d dbpackage.Status) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetStatus(d)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetNillableStatus sets the "status" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableStatus(i *int) *DbPackageUpdateOne {
|
||||
if i != nil {
|
||||
dpuo.SetStatus(*i)
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableStatus(d *dbpackage.Status) *DbPackageUpdateOne {
|
||||
if d != nil {
|
||||
dpuo.SetStatus(*d)
|
||||
}
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// AddStatus adds i to the "status" field.
|
||||
func (dpuo *DbPackageUpdateOne) AddStatus(i int) *DbPackageUpdateOne {
|
||||
dpuo.mutation.AddStatus(i)
|
||||
// ClearStatus clears the value of the "status" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearStatus() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearStatus()
|
||||
return dpuo
|
||||
}
|
||||
|
||||
@@ -539,8 +517,8 @@ func (dpuo *DbPackageUpdateOne) ClearSkipReason() *DbPackageUpdateOne {
|
||||
}
|
||||
|
||||
// SetRepository sets the "repository" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetRepository(s string) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetRepository(s)
|
||||
func (dpuo *DbPackageUpdateOne) SetRepository(d dbpackage.Repository) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetRepository(d)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
@@ -590,50 +568,43 @@ func (dpuo *DbPackageUpdateOne) ClearRepoVersion() *DbPackageUpdateOne {
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetBuildTime sets the "build_time" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetBuildTime(t time.Time) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetBuildTime(t)
|
||||
// SetBuildTimeStart sets the "build_time_start" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetBuildTimeStart(t time.Time) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetBuildTimeStart(t)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetNillableBuildTime sets the "build_time" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableBuildTime(t *time.Time) *DbPackageUpdateOne {
|
||||
// SetNillableBuildTimeStart sets the "build_time_start" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableBuildTimeStart(t *time.Time) *DbPackageUpdateOne {
|
||||
if t != nil {
|
||||
dpuo.SetBuildTime(*t)
|
||||
dpuo.SetBuildTimeStart(*t)
|
||||
}
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// ClearBuildTime clears the value of the "build_time" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearBuildTime() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearBuildTime()
|
||||
// ClearBuildTimeStart clears the value of the "build_time_start" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearBuildTimeStart() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearBuildTimeStart()
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetBuildDuration sets the "build_duration" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetBuildDuration(u uint64) *DbPackageUpdateOne {
|
||||
dpuo.mutation.ResetBuildDuration()
|
||||
dpuo.mutation.SetBuildDuration(u)
|
||||
// SetBuildTimeEnd sets the "build_time_end" field.
|
||||
func (dpuo *DbPackageUpdateOne) SetBuildTimeEnd(t time.Time) *DbPackageUpdateOne {
|
||||
dpuo.mutation.SetBuildTimeEnd(t)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// SetNillableBuildDuration sets the "build_duration" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableBuildDuration(u *uint64) *DbPackageUpdateOne {
|
||||
if u != nil {
|
||||
dpuo.SetBuildDuration(*u)
|
||||
// SetNillableBuildTimeEnd sets the "build_time_end" field if the given value is not nil.
|
||||
func (dpuo *DbPackageUpdateOne) SetNillableBuildTimeEnd(t *time.Time) *DbPackageUpdateOne {
|
||||
if t != nil {
|
||||
dpuo.SetBuildTimeEnd(*t)
|
||||
}
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// AddBuildDuration adds u to the "build_duration" field.
|
||||
func (dpuo *DbPackageUpdateOne) AddBuildDuration(u uint64) *DbPackageUpdateOne {
|
||||
dpuo.mutation.AddBuildDuration(u)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// ClearBuildDuration clears the value of the "build_duration" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearBuildDuration() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearBuildDuration()
|
||||
// ClearBuildTimeEnd clears the value of the "build_time_end" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearBuildTimeEnd() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearBuildTimeEnd()
|
||||
return dpuo
|
||||
}
|
||||
|
||||
@@ -766,11 +737,6 @@ func (dpuo *DbPackageUpdateOne) check() error {
|
||||
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
|
||||
}
|
||||
}
|
||||
if v, ok := dpuo.mutation.BuildDuration(); ok {
|
||||
if err := dbpackage.BuildDurationValidator(v); err != nil {
|
||||
return &ValidationError{Name: "build_duration", err: fmt.Errorf("ent: validator failed for field \"build_duration\": %w", err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -824,15 +790,14 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
||||
}
|
||||
if value, ok := dpuo.mutation.Status(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedStatus(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
if dpuo.mutation.StatusCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
}
|
||||
@@ -851,7 +816,7 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
||||
}
|
||||
if value, ok := dpuo.mutation.Repository(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepository,
|
||||
})
|
||||
@@ -889,37 +854,30 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.BuildTime(); ok {
|
||||
if value, ok := dpuo.mutation.BuildTimeStart(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
}
|
||||
if dpuo.mutation.BuildTimeCleared() {
|
||||
if dpuo.mutation.BuildTimeStartCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldBuildTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.BuildDuration(); ok {
|
||||
if value, ok := dpuo.mutation.BuildTimeEnd(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
Column: dbpackage.FieldBuildTimeEnd,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedBuildDuration(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
})
|
||||
}
|
||||
if dpuo.mutation.BuildDurationCleared() {
|
||||
if dpuo.mutation.BuildTimeEndCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Column: dbpackage.FieldBuildDuration,
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldBuildTimeEnd,
|
||||
})
|
||||
}
|
||||
if value, ok := dpuo.mutation.Updated(); ok {
|
||||
|
3
ent/generate.go
Normal file
3
ent/generate.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package ent
|
||||
|
||||
//go:generate go run -mod=mod entgo.io/ent/cmd/ent generate --feature sql/modifier ./schema
|
@@ -13,14 +13,14 @@ var (
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "pkgbase", Type: field.TypeString, Unique: true},
|
||||
{Name: "packages", Type: field.TypeJSON, Nullable: true},
|
||||
{Name: "status", Type: field.TypeInt, Default: 6},
|
||||
{Name: "status", Type: field.TypeEnum, Nullable: true, Enums: []string{"skipped", "failed", "build", "queued", "building", "latest", "signing", "unknown"}, Default: "unknown"},
|
||||
{Name: "skip_reason", Type: field.TypeString, Nullable: true},
|
||||
{Name: "repository", Type: field.TypeString},
|
||||
{Name: "repository", Type: field.TypeEnum, Enums: []string{"extra", "core", "community"}},
|
||||
{Name: "march", Type: field.TypeString},
|
||||
{Name: "version", Type: field.TypeString, Nullable: true},
|
||||
{Name: "repo_version", Type: field.TypeString, Nullable: true},
|
||||
{Name: "build_time", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "build_duration", Type: field.TypeUint64, Nullable: true},
|
||||
{Name: "build_time_start", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "build_time_end", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "updated", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "hash", Type: field.TypeString, Nullable: true},
|
||||
}
|
||||
|
291
ent/mutation.go
291
ent/mutation.go
@@ -29,27 +29,25 @@ const (
|
||||
// DbPackageMutation represents an operation that mutates the DbPackage nodes in the graph.
|
||||
type DbPackageMutation struct {
|
||||
config
|
||||
op Op
|
||||
typ string
|
||||
id *int
|
||||
pkgbase *string
|
||||
packages *[]string
|
||||
status *int
|
||||
addstatus *int
|
||||
skip_reason *string
|
||||
repository *string
|
||||
march *string
|
||||
version *string
|
||||
repo_version *string
|
||||
build_time *time.Time
|
||||
build_duration *uint64
|
||||
addbuild_duration *uint64
|
||||
updated *time.Time
|
||||
hash *string
|
||||
clearedFields map[string]struct{}
|
||||
done bool
|
||||
oldValue func(context.Context) (*DbPackage, error)
|
||||
predicates []predicate.DbPackage
|
||||
op Op
|
||||
typ string
|
||||
id *int
|
||||
pkgbase *string
|
||||
packages *[]string
|
||||
status *dbpackage.Status
|
||||
skip_reason *string
|
||||
repository *dbpackage.Repository
|
||||
march *string
|
||||
version *string
|
||||
repo_version *string
|
||||
build_time_start *time.Time
|
||||
build_time_end *time.Time
|
||||
updated *time.Time
|
||||
hash *string
|
||||
clearedFields map[string]struct{}
|
||||
done bool
|
||||
oldValue func(context.Context) (*DbPackage, error)
|
||||
predicates []predicate.DbPackage
|
||||
}
|
||||
|
||||
var _ ent.Mutation = (*DbPackageMutation)(nil)
|
||||
@@ -217,13 +215,12 @@ func (m *DbPackageMutation) ResetPackages() {
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (m *DbPackageMutation) SetStatus(i int) {
|
||||
m.status = &i
|
||||
m.addstatus = nil
|
||||
func (m *DbPackageMutation) SetStatus(d dbpackage.Status) {
|
||||
m.status = &d
|
||||
}
|
||||
|
||||
// Status returns the value of the "status" field in the mutation.
|
||||
func (m *DbPackageMutation) Status() (r int, exists bool) {
|
||||
func (m *DbPackageMutation) Status() (r dbpackage.Status, exists bool) {
|
||||
v := m.status
|
||||
if v == nil {
|
||||
return
|
||||
@@ -234,7 +231,7 @@ func (m *DbPackageMutation) Status() (r int, exists bool) {
|
||||
// OldStatus returns the old "status" field's value of the DbPackage entity.
|
||||
// If the DbPackage object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *DbPackageMutation) OldStatus(ctx context.Context) (v int, err error) {
|
||||
func (m *DbPackageMutation) OldStatus(ctx context.Context) (v dbpackage.Status, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, fmt.Errorf("OldStatus is only allowed on UpdateOne operations")
|
||||
}
|
||||
@@ -248,28 +245,22 @@ func (m *DbPackageMutation) OldStatus(ctx context.Context) (v int, err error) {
|
||||
return oldValue.Status, nil
|
||||
}
|
||||
|
||||
// AddStatus adds i to the "status" field.
|
||||
func (m *DbPackageMutation) AddStatus(i int) {
|
||||
if m.addstatus != nil {
|
||||
*m.addstatus += i
|
||||
} else {
|
||||
m.addstatus = &i
|
||||
}
|
||||
// ClearStatus clears the value of the "status" field.
|
||||
func (m *DbPackageMutation) ClearStatus() {
|
||||
m.status = nil
|
||||
m.clearedFields[dbpackage.FieldStatus] = struct{}{}
|
||||
}
|
||||
|
||||
// AddedStatus returns the value that was added to the "status" field in this mutation.
|
||||
func (m *DbPackageMutation) AddedStatus() (r int, exists bool) {
|
||||
v := m.addstatus
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
// StatusCleared returns if the "status" field was cleared in this mutation.
|
||||
func (m *DbPackageMutation) StatusCleared() bool {
|
||||
_, ok := m.clearedFields[dbpackage.FieldStatus]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetStatus resets all changes to the "status" field.
|
||||
func (m *DbPackageMutation) ResetStatus() {
|
||||
m.status = nil
|
||||
m.addstatus = nil
|
||||
delete(m.clearedFields, dbpackage.FieldStatus)
|
||||
}
|
||||
|
||||
// SetSkipReason sets the "skip_reason" field.
|
||||
@@ -322,12 +313,12 @@ func (m *DbPackageMutation) ResetSkipReason() {
|
||||
}
|
||||
|
||||
// SetRepository sets the "repository" field.
|
||||
func (m *DbPackageMutation) SetRepository(s string) {
|
||||
m.repository = &s
|
||||
func (m *DbPackageMutation) SetRepository(d dbpackage.Repository) {
|
||||
m.repository = &d
|
||||
}
|
||||
|
||||
// Repository returns the value of the "repository" field in the mutation.
|
||||
func (m *DbPackageMutation) Repository() (r string, exists bool) {
|
||||
func (m *DbPackageMutation) Repository() (r dbpackage.Repository, exists bool) {
|
||||
v := m.repository
|
||||
if v == nil {
|
||||
return
|
||||
@@ -338,7 +329,7 @@ func (m *DbPackageMutation) Repository() (r string, exists bool) {
|
||||
// OldRepository returns the old "repository" field's value of the DbPackage entity.
|
||||
// If the DbPackage object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *DbPackageMutation) OldRepository(ctx context.Context) (v string, err error) {
|
||||
func (m *DbPackageMutation) OldRepository(ctx context.Context) (v dbpackage.Repository, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, fmt.Errorf("OldRepository is only allowed on UpdateOne operations")
|
||||
}
|
||||
@@ -491,123 +482,102 @@ func (m *DbPackageMutation) ResetRepoVersion() {
|
||||
delete(m.clearedFields, dbpackage.FieldRepoVersion)
|
||||
}
|
||||
|
||||
// SetBuildTime sets the "build_time" field.
|
||||
func (m *DbPackageMutation) SetBuildTime(t time.Time) {
|
||||
m.build_time = &t
|
||||
// SetBuildTimeStart sets the "build_time_start" field.
|
||||
func (m *DbPackageMutation) SetBuildTimeStart(t time.Time) {
|
||||
m.build_time_start = &t
|
||||
}
|
||||
|
||||
// BuildTime returns the value of the "build_time" field in the mutation.
|
||||
func (m *DbPackageMutation) BuildTime() (r time.Time, exists bool) {
|
||||
v := m.build_time
|
||||
// BuildTimeStart returns the value of the "build_time_start" field in the mutation.
|
||||
func (m *DbPackageMutation) BuildTimeStart() (r time.Time, exists bool) {
|
||||
v := m.build_time_start
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBuildTime returns the old "build_time" field's value of the DbPackage entity.
|
||||
// OldBuildTimeStart returns the old "build_time_start" field's value of the DbPackage entity.
|
||||
// If the DbPackage object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *DbPackageMutation) OldBuildTime(ctx context.Context) (v time.Time, err error) {
|
||||
func (m *DbPackageMutation) OldBuildTimeStart(ctx context.Context) (v time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, fmt.Errorf("OldBuildTime is only allowed on UpdateOne operations")
|
||||
return v, fmt.Errorf("OldBuildTimeStart is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, fmt.Errorf("OldBuildTime requires an ID field in the mutation")
|
||||
return v, fmt.Errorf("OldBuildTimeStart requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBuildTime: %w", err)
|
||||
return v, fmt.Errorf("querying old value for OldBuildTimeStart: %w", err)
|
||||
}
|
||||
return oldValue.BuildTime, nil
|
||||
return oldValue.BuildTimeStart, nil
|
||||
}
|
||||
|
||||
// ClearBuildTime clears the value of the "build_time" field.
|
||||
func (m *DbPackageMutation) ClearBuildTime() {
|
||||
m.build_time = nil
|
||||
m.clearedFields[dbpackage.FieldBuildTime] = struct{}{}
|
||||
// ClearBuildTimeStart clears the value of the "build_time_start" field.
|
||||
func (m *DbPackageMutation) ClearBuildTimeStart() {
|
||||
m.build_time_start = nil
|
||||
m.clearedFields[dbpackage.FieldBuildTimeStart] = struct{}{}
|
||||
}
|
||||
|
||||
// BuildTimeCleared returns if the "build_time" field was cleared in this mutation.
|
||||
func (m *DbPackageMutation) BuildTimeCleared() bool {
|
||||
_, ok := m.clearedFields[dbpackage.FieldBuildTime]
|
||||
// BuildTimeStartCleared returns if the "build_time_start" field was cleared in this mutation.
|
||||
func (m *DbPackageMutation) BuildTimeStartCleared() bool {
|
||||
_, ok := m.clearedFields[dbpackage.FieldBuildTimeStart]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBuildTime resets all changes to the "build_time" field.
|
||||
func (m *DbPackageMutation) ResetBuildTime() {
|
||||
m.build_time = nil
|
||||
delete(m.clearedFields, dbpackage.FieldBuildTime)
|
||||
// ResetBuildTimeStart resets all changes to the "build_time_start" field.
|
||||
func (m *DbPackageMutation) ResetBuildTimeStart() {
|
||||
m.build_time_start = nil
|
||||
delete(m.clearedFields, dbpackage.FieldBuildTimeStart)
|
||||
}
|
||||
|
||||
// SetBuildDuration sets the "build_duration" field.
|
||||
func (m *DbPackageMutation) SetBuildDuration(u uint64) {
|
||||
m.build_duration = &u
|
||||
m.addbuild_duration = nil
|
||||
// SetBuildTimeEnd sets the "build_time_end" field.
|
||||
func (m *DbPackageMutation) SetBuildTimeEnd(t time.Time) {
|
||||
m.build_time_end = &t
|
||||
}
|
||||
|
||||
// BuildDuration returns the value of the "build_duration" field in the mutation.
|
||||
func (m *DbPackageMutation) BuildDuration() (r uint64, exists bool) {
|
||||
v := m.build_duration
|
||||
// BuildTimeEnd returns the value of the "build_time_end" field in the mutation.
|
||||
func (m *DbPackageMutation) BuildTimeEnd() (r time.Time, exists bool) {
|
||||
v := m.build_time_end
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldBuildDuration returns the old "build_duration" field's value of the DbPackage entity.
|
||||
// OldBuildTimeEnd returns the old "build_time_end" field's value of the DbPackage entity.
|
||||
// If the DbPackage object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *DbPackageMutation) OldBuildDuration(ctx context.Context) (v uint64, err error) {
|
||||
func (m *DbPackageMutation) OldBuildTimeEnd(ctx context.Context) (v time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, fmt.Errorf("OldBuildDuration is only allowed on UpdateOne operations")
|
||||
return v, fmt.Errorf("OldBuildTimeEnd is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, fmt.Errorf("OldBuildDuration requires an ID field in the mutation")
|
||||
return v, fmt.Errorf("OldBuildTimeEnd requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldBuildDuration: %w", err)
|
||||
return v, fmt.Errorf("querying old value for OldBuildTimeEnd: %w", err)
|
||||
}
|
||||
return oldValue.BuildDuration, nil
|
||||
return oldValue.BuildTimeEnd, nil
|
||||
}
|
||||
|
||||
// AddBuildDuration adds u to the "build_duration" field.
|
||||
func (m *DbPackageMutation) AddBuildDuration(u uint64) {
|
||||
if m.addbuild_duration != nil {
|
||||
*m.addbuild_duration += u
|
||||
} else {
|
||||
m.addbuild_duration = &u
|
||||
}
|
||||
// ClearBuildTimeEnd clears the value of the "build_time_end" field.
|
||||
func (m *DbPackageMutation) ClearBuildTimeEnd() {
|
||||
m.build_time_end = nil
|
||||
m.clearedFields[dbpackage.FieldBuildTimeEnd] = struct{}{}
|
||||
}
|
||||
|
||||
// AddedBuildDuration returns the value that was added to the "build_duration" field in this mutation.
|
||||
func (m *DbPackageMutation) AddedBuildDuration() (r uint64, exists bool) {
|
||||
v := m.addbuild_duration
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearBuildDuration clears the value of the "build_duration" field.
|
||||
func (m *DbPackageMutation) ClearBuildDuration() {
|
||||
m.build_duration = nil
|
||||
m.addbuild_duration = nil
|
||||
m.clearedFields[dbpackage.FieldBuildDuration] = struct{}{}
|
||||
}
|
||||
|
||||
// BuildDurationCleared returns if the "build_duration" field was cleared in this mutation.
|
||||
func (m *DbPackageMutation) BuildDurationCleared() bool {
|
||||
_, ok := m.clearedFields[dbpackage.FieldBuildDuration]
|
||||
// BuildTimeEndCleared returns if the "build_time_end" field was cleared in this mutation.
|
||||
func (m *DbPackageMutation) BuildTimeEndCleared() bool {
|
||||
_, ok := m.clearedFields[dbpackage.FieldBuildTimeEnd]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetBuildDuration resets all changes to the "build_duration" field.
|
||||
func (m *DbPackageMutation) ResetBuildDuration() {
|
||||
m.build_duration = nil
|
||||
m.addbuild_duration = nil
|
||||
delete(m.clearedFields, dbpackage.FieldBuildDuration)
|
||||
// ResetBuildTimeEnd resets all changes to the "build_time_end" field.
|
||||
func (m *DbPackageMutation) ResetBuildTimeEnd() {
|
||||
m.build_time_end = nil
|
||||
delete(m.clearedFields, dbpackage.FieldBuildTimeEnd)
|
||||
}
|
||||
|
||||
// SetUpdated sets the "updated" field.
|
||||
@@ -752,11 +722,11 @@ func (m *DbPackageMutation) Fields() []string {
|
||||
if m.repo_version != nil {
|
||||
fields = append(fields, dbpackage.FieldRepoVersion)
|
||||
}
|
||||
if m.build_time != nil {
|
||||
fields = append(fields, dbpackage.FieldBuildTime)
|
||||
if m.build_time_start != nil {
|
||||
fields = append(fields, dbpackage.FieldBuildTimeStart)
|
||||
}
|
||||
if m.build_duration != nil {
|
||||
fields = append(fields, dbpackage.FieldBuildDuration)
|
||||
if m.build_time_end != nil {
|
||||
fields = append(fields, dbpackage.FieldBuildTimeEnd)
|
||||
}
|
||||
if m.updated != nil {
|
||||
fields = append(fields, dbpackage.FieldUpdated)
|
||||
@@ -788,10 +758,10 @@ func (m *DbPackageMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.Version()
|
||||
case dbpackage.FieldRepoVersion:
|
||||
return m.RepoVersion()
|
||||
case dbpackage.FieldBuildTime:
|
||||
return m.BuildTime()
|
||||
case dbpackage.FieldBuildDuration:
|
||||
return m.BuildDuration()
|
||||
case dbpackage.FieldBuildTimeStart:
|
||||
return m.BuildTimeStart()
|
||||
case dbpackage.FieldBuildTimeEnd:
|
||||
return m.BuildTimeEnd()
|
||||
case dbpackage.FieldUpdated:
|
||||
return m.Updated()
|
||||
case dbpackage.FieldHash:
|
||||
@@ -821,10 +791,10 @@ func (m *DbPackageMutation) OldField(ctx context.Context, name string) (ent.Valu
|
||||
return m.OldVersion(ctx)
|
||||
case dbpackage.FieldRepoVersion:
|
||||
return m.OldRepoVersion(ctx)
|
||||
case dbpackage.FieldBuildTime:
|
||||
return m.OldBuildTime(ctx)
|
||||
case dbpackage.FieldBuildDuration:
|
||||
return m.OldBuildDuration(ctx)
|
||||
case dbpackage.FieldBuildTimeStart:
|
||||
return m.OldBuildTimeStart(ctx)
|
||||
case dbpackage.FieldBuildTimeEnd:
|
||||
return m.OldBuildTimeEnd(ctx)
|
||||
case dbpackage.FieldUpdated:
|
||||
return m.OldUpdated(ctx)
|
||||
case dbpackage.FieldHash:
|
||||
@@ -853,7 +823,7 @@ func (m *DbPackageMutation) SetField(name string, value ent.Value) error {
|
||||
m.SetPackages(v)
|
||||
return nil
|
||||
case dbpackage.FieldStatus:
|
||||
v, ok := value.(int)
|
||||
v, ok := value.(dbpackage.Status)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
@@ -867,7 +837,7 @@ func (m *DbPackageMutation) SetField(name string, value ent.Value) error {
|
||||
m.SetSkipReason(v)
|
||||
return nil
|
||||
case dbpackage.FieldRepository:
|
||||
v, ok := value.(string)
|
||||
v, ok := value.(dbpackage.Repository)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
@@ -894,19 +864,19 @@ func (m *DbPackageMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetRepoVersion(v)
|
||||
return nil
|
||||
case dbpackage.FieldBuildTime:
|
||||
case dbpackage.FieldBuildTimeStart:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBuildTime(v)
|
||||
m.SetBuildTimeStart(v)
|
||||
return nil
|
||||
case dbpackage.FieldBuildDuration:
|
||||
v, ok := value.(uint64)
|
||||
case dbpackage.FieldBuildTimeEnd:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetBuildDuration(v)
|
||||
m.SetBuildTimeEnd(v)
|
||||
return nil
|
||||
case dbpackage.FieldUpdated:
|
||||
v, ok := value.(time.Time)
|
||||
@@ -929,26 +899,13 @@ func (m *DbPackageMutation) SetField(name string, value ent.Value) error {
|
||||
// AddedFields returns all numeric fields that were incremented/decremented during
|
||||
// this mutation.
|
||||
func (m *DbPackageMutation) AddedFields() []string {
|
||||
var fields []string
|
||||
if m.addstatus != nil {
|
||||
fields = append(fields, dbpackage.FieldStatus)
|
||||
}
|
||||
if m.addbuild_duration != nil {
|
||||
fields = append(fields, dbpackage.FieldBuildDuration)
|
||||
}
|
||||
return fields
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddedField returns the numeric value that was incremented/decremented on a field
|
||||
// with the given name. The second boolean return value indicates that this field
|
||||
// was not set, or was not defined in the schema.
|
||||
func (m *DbPackageMutation) AddedField(name string) (ent.Value, bool) {
|
||||
switch name {
|
||||
case dbpackage.FieldStatus:
|
||||
return m.AddedStatus()
|
||||
case dbpackage.FieldBuildDuration:
|
||||
return m.AddedBuildDuration()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
@@ -957,20 +914,6 @@ func (m *DbPackageMutation) AddedField(name string) (ent.Value, bool) {
|
||||
// type.
|
||||
func (m *DbPackageMutation) AddField(name string, value ent.Value) error {
|
||||
switch name {
|
||||
case dbpackage.FieldStatus:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddStatus(v)
|
||||
return nil
|
||||
case dbpackage.FieldBuildDuration:
|
||||
v, ok := value.(uint64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddBuildDuration(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown DbPackage numeric field %s", name)
|
||||
}
|
||||
@@ -982,6 +925,9 @@ func (m *DbPackageMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(dbpackage.FieldPackages) {
|
||||
fields = append(fields, dbpackage.FieldPackages)
|
||||
}
|
||||
if m.FieldCleared(dbpackage.FieldStatus) {
|
||||
fields = append(fields, dbpackage.FieldStatus)
|
||||
}
|
||||
if m.FieldCleared(dbpackage.FieldSkipReason) {
|
||||
fields = append(fields, dbpackage.FieldSkipReason)
|
||||
}
|
||||
@@ -991,11 +937,11 @@ func (m *DbPackageMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(dbpackage.FieldRepoVersion) {
|
||||
fields = append(fields, dbpackage.FieldRepoVersion)
|
||||
}
|
||||
if m.FieldCleared(dbpackage.FieldBuildTime) {
|
||||
fields = append(fields, dbpackage.FieldBuildTime)
|
||||
if m.FieldCleared(dbpackage.FieldBuildTimeStart) {
|
||||
fields = append(fields, dbpackage.FieldBuildTimeStart)
|
||||
}
|
||||
if m.FieldCleared(dbpackage.FieldBuildDuration) {
|
||||
fields = append(fields, dbpackage.FieldBuildDuration)
|
||||
if m.FieldCleared(dbpackage.FieldBuildTimeEnd) {
|
||||
fields = append(fields, dbpackage.FieldBuildTimeEnd)
|
||||
}
|
||||
if m.FieldCleared(dbpackage.FieldUpdated) {
|
||||
fields = append(fields, dbpackage.FieldUpdated)
|
||||
@@ -1020,6 +966,9 @@ func (m *DbPackageMutation) ClearField(name string) error {
|
||||
case dbpackage.FieldPackages:
|
||||
m.ClearPackages()
|
||||
return nil
|
||||
case dbpackage.FieldStatus:
|
||||
m.ClearStatus()
|
||||
return nil
|
||||
case dbpackage.FieldSkipReason:
|
||||
m.ClearSkipReason()
|
||||
return nil
|
||||
@@ -1029,11 +978,11 @@ func (m *DbPackageMutation) ClearField(name string) error {
|
||||
case dbpackage.FieldRepoVersion:
|
||||
m.ClearRepoVersion()
|
||||
return nil
|
||||
case dbpackage.FieldBuildTime:
|
||||
m.ClearBuildTime()
|
||||
case dbpackage.FieldBuildTimeStart:
|
||||
m.ClearBuildTimeStart()
|
||||
return nil
|
||||
case dbpackage.FieldBuildDuration:
|
||||
m.ClearBuildDuration()
|
||||
case dbpackage.FieldBuildTimeEnd:
|
||||
m.ClearBuildTimeEnd()
|
||||
return nil
|
||||
case dbpackage.FieldUpdated:
|
||||
m.ClearUpdated()
|
||||
@@ -1073,11 +1022,11 @@ func (m *DbPackageMutation) ResetField(name string) error {
|
||||
case dbpackage.FieldRepoVersion:
|
||||
m.ResetRepoVersion()
|
||||
return nil
|
||||
case dbpackage.FieldBuildTime:
|
||||
m.ResetBuildTime()
|
||||
case dbpackage.FieldBuildTimeStart:
|
||||
m.ResetBuildTimeStart()
|
||||
return nil
|
||||
case dbpackage.FieldBuildDuration:
|
||||
m.ResetBuildDuration()
|
||||
case dbpackage.FieldBuildTimeEnd:
|
||||
m.ResetBuildTimeEnd()
|
||||
return nil
|
||||
case dbpackage.FieldUpdated:
|
||||
m.ResetUpdated()
|
||||
|
@@ -17,22 +17,8 @@ func init() {
|
||||
dbpackageDescPkgbase := dbpackageFields[0].Descriptor()
|
||||
// dbpackage.PkgbaseValidator is a validator for the "pkgbase" field. It is called by the builders before save.
|
||||
dbpackage.PkgbaseValidator = dbpackageDescPkgbase.Validators[0].(func(string) error)
|
||||
// dbpackageDescStatus is the schema descriptor for status field.
|
||||
dbpackageDescStatus := dbpackageFields[2].Descriptor()
|
||||
// dbpackage.DefaultStatus holds the default value on creation for the status field.
|
||||
dbpackage.DefaultStatus = dbpackageDescStatus.Default.(int)
|
||||
// dbpackage.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
dbpackage.StatusValidator = dbpackageDescStatus.Validators[0].(func(int) error)
|
||||
// dbpackageDescRepository is the schema descriptor for repository field.
|
||||
dbpackageDescRepository := dbpackageFields[4].Descriptor()
|
||||
// dbpackage.RepositoryValidator is a validator for the "repository" field. It is called by the builders before save.
|
||||
dbpackage.RepositoryValidator = dbpackageDescRepository.Validators[0].(func(string) error)
|
||||
// dbpackageDescMarch is the schema descriptor for march field.
|
||||
dbpackageDescMarch := dbpackageFields[5].Descriptor()
|
||||
// dbpackage.MarchValidator is a validator for the "march" field. It is called by the builders before save.
|
||||
dbpackage.MarchValidator = dbpackageDescMarch.Validators[0].(func(string) error)
|
||||
// dbpackageDescBuildDuration is the schema descriptor for build_duration field.
|
||||
dbpackageDescBuildDuration := dbpackageFields[9].Descriptor()
|
||||
// dbpackage.BuildDurationValidator is a validator for the "build_duration" field. It is called by the builders before save.
|
||||
dbpackage.BuildDurationValidator = dbpackageDescBuildDuration.Validators[0].(func(uint64) error)
|
||||
}
|
||||
|
@@ -15,14 +15,14 @@ func (DbPackage) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.String("pkgbase").NotEmpty().Immutable().Unique(),
|
||||
field.Strings("packages").Optional(),
|
||||
field.Int("status").Min(0).Default(6),
|
||||
field.Enum("status").Values("skipped", "failed", "build", "queued", "building", "latest", "signing", "unknown").Default("unknown").Optional(),
|
||||
field.String("skip_reason").Optional(),
|
||||
field.String("repository").NotEmpty(),
|
||||
field.Enum("repository").Values("extra", "core", "community"),
|
||||
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("build_time_start").Optional(),
|
||||
field.Time("build_time_end").Optional(),
|
||||
field.Time("updated").Optional(),
|
||||
field.String("hash").Optional(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user