forked from ALHP/ALHP.GO
updated schema to allow multiple pkgbases/march
This commit is contained in:
@@ -85,12 +85,6 @@ func (dpu *DbPackageUpdate) SetRepository(d dbpackage.Repository) *DbPackageUpda
|
|||||||
return dpu
|
return dpu
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetMarch sets the "march" field.
|
|
||||||
func (dpu *DbPackageUpdate) SetMarch(s string) *DbPackageUpdate {
|
|
||||||
dpu.mutation.SetMarch(s)
|
|
||||||
return dpu
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetVersion sets the "version" field.
|
// SetVersion sets the "version" field.
|
||||||
func (dpu *DbPackageUpdate) SetVersion(s string) *DbPackageUpdate {
|
func (dpu *DbPackageUpdate) SetVersion(s string) *DbPackageUpdate {
|
||||||
dpu.mutation.SetVersion(s)
|
dpu.mutation.SetVersion(s)
|
||||||
@@ -328,11 +322,6 @@ func (dpu *DbPackageUpdate) check() error {
|
|||||||
return &ValidationError{Name: "repository", err: fmt.Errorf("ent: validator failed for field \"repository\": %w", err)}
|
return &ValidationError{Name: "repository", err: fmt.Errorf("ent: validator failed for field \"repository\": %w", err)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if v, ok := dpu.mutation.March(); ok {
|
|
||||||
if err := dbpackage.MarchValidator(v); err != nil {
|
|
||||||
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if v, ok := dpu.mutation.Lto(); ok {
|
if v, ok := dpu.mutation.Lto(); ok {
|
||||||
if err := dbpackage.LtoValidator(v); err != nil {
|
if err := dbpackage.LtoValidator(v); err != nil {
|
||||||
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
|
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
|
||||||
@@ -405,13 +394,6 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|||||||
Column: dbpackage.FieldRepository,
|
Column: dbpackage.FieldRepository,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if value, ok := dpu.mutation.March(); ok {
|
|
||||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
||||||
Type: field.TypeString,
|
|
||||||
Value: value,
|
|
||||||
Column: dbpackage.FieldMarch,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if value, ok := dpu.mutation.Version(); ok {
|
if value, ok := dpu.mutation.Version(); ok {
|
||||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||||
Type: field.TypeString,
|
Type: field.TypeString,
|
||||||
@@ -593,12 +575,6 @@ func (dpuo *DbPackageUpdateOne) SetRepository(d dbpackage.Repository) *DbPackage
|
|||||||
return dpuo
|
return dpuo
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetMarch sets the "march" field.
|
|
||||||
func (dpuo *DbPackageUpdateOne) SetMarch(s string) *DbPackageUpdateOne {
|
|
||||||
dpuo.mutation.SetMarch(s)
|
|
||||||
return dpuo
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetVersion sets the "version" field.
|
// SetVersion sets the "version" field.
|
||||||
func (dpuo *DbPackageUpdateOne) SetVersion(s string) *DbPackageUpdateOne {
|
func (dpuo *DbPackageUpdateOne) SetVersion(s string) *DbPackageUpdateOne {
|
||||||
dpuo.mutation.SetVersion(s)
|
dpuo.mutation.SetVersion(s)
|
||||||
@@ -843,11 +819,6 @@ func (dpuo *DbPackageUpdateOne) check() error {
|
|||||||
return &ValidationError{Name: "repository", err: fmt.Errorf("ent: validator failed for field \"repository\": %w", err)}
|
return &ValidationError{Name: "repository", err: fmt.Errorf("ent: validator failed for field \"repository\": %w", err)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if v, ok := dpuo.mutation.March(); ok {
|
|
||||||
if err := dbpackage.MarchValidator(v); err != nil {
|
|
||||||
return &ValidationError{Name: "march", err: fmt.Errorf("ent: validator failed for field \"march\": %w", err)}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if v, ok := dpuo.mutation.Lto(); ok {
|
if v, ok := dpuo.mutation.Lto(); ok {
|
||||||
if err := dbpackage.LtoValidator(v); err != nil {
|
if err := dbpackage.LtoValidator(v); err != nil {
|
||||||
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
|
return &ValidationError{Name: "lto", err: fmt.Errorf("ent: validator failed for field \"lto\": %w", err)}
|
||||||
@@ -937,13 +908,6 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
|||||||
Column: dbpackage.FieldRepository,
|
Column: dbpackage.FieldRepository,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if value, ok := dpuo.mutation.March(); ok {
|
|
||||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
||||||
Type: field.TypeString,
|
|
||||||
Value: value,
|
|
||||||
Column: dbpackage.FieldMarch,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if value, ok := dpuo.mutation.Version(); ok {
|
if value, ok := dpuo.mutation.Version(); ok {
|
||||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||||
Type: field.TypeString,
|
Type: field.TypeString,
|
||||||
|
@@ -11,7 +11,7 @@ var (
|
|||||||
// DbPackagesColumns holds the columns for the "db_packages" table.
|
// DbPackagesColumns holds the columns for the "db_packages" table.
|
||||||
DbPackagesColumns = []*schema.Column{
|
DbPackagesColumns = []*schema.Column{
|
||||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||||
{Name: "pkgbase", Type: field.TypeString, Unique: true},
|
{Name: "pkgbase", Type: field.TypeString},
|
||||||
{Name: "packages", Type: field.TypeJSON, Nullable: true},
|
{Name: "packages", Type: field.TypeJSON, Nullable: true},
|
||||||
{Name: "status", Type: field.TypeEnum, Nullable: true, Enums: []string{"skipped", "failed", "build", "queued", "building", "latest", "signing", "unknown"}, Default: "unknown"},
|
{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: "skip_reason", Type: field.TypeString, Nullable: true},
|
||||||
|
@@ -13,12 +13,12 @@ type DbPackage struct {
|
|||||||
// Fields of the DbPackage.
|
// Fields of the DbPackage.
|
||||||
func (DbPackage) Fields() []ent.Field {
|
func (DbPackage) Fields() []ent.Field {
|
||||||
return []ent.Field{
|
return []ent.Field{
|
||||||
field.String("pkgbase").NotEmpty().Immutable().Unique(),
|
field.String("pkgbase").NotEmpty().Immutable(),
|
||||||
field.Strings("packages").Optional(),
|
field.Strings("packages").Optional(),
|
||||||
field.Enum("status").Values("skipped", "failed", "build", "queued", "building", "latest", "signing", "unknown").Default("unknown").Optional(),
|
field.Enum("status").Values("skipped", "failed", "build", "queued", "building", "latest", "signing", "unknown").Default("unknown").Optional(),
|
||||||
field.String("skip_reason").Optional(),
|
field.String("skip_reason").Optional(),
|
||||||
field.Enum("repository").Values("extra", "core", "community"),
|
field.Enum("repository").Values("extra", "core", "community"),
|
||||||
field.String("march").NotEmpty(),
|
field.String("march").NotEmpty().Immutable(),
|
||||||
field.String("version").Optional(),
|
field.String("version").Optional(),
|
||||||
field.String("repo_version").Optional(),
|
field.String("repo_version").Optional(),
|
||||||
field.Time("build_time_start").Optional(),
|
field.Time("build_time_start").Optional(),
|
||||||
|
Reference in New Issue
Block a user