diff --git a/pkg/database/ent/machine.go b/pkg/database/ent/machine.go index fddb2e6a8b3..24c9fdb57e6 100644 --- a/pkg/database/ent/machine.go +++ b/pkg/database/ent/machine.go @@ -39,8 +39,6 @@ type Machine struct { Version string `json:"version,omitempty"` // IsValidated holds the value of the "isValidated" field. IsValidated bool `json:"isValidated,omitempty"` - // Status holds the value of the "status" field. - Status string `json:"status,omitempty"` // AuthType holds the value of the "auth_type" field. AuthType string `json:"auth_type"` // Osname holds the value of the "osname" field. @@ -88,7 +86,7 @@ func (*Machine) scanValues(columns []string) ([]any, error) { values[i] = new(sql.NullBool) case machine.FieldID: values[i] = new(sql.NullInt64) - case machine.FieldMachineId, machine.FieldPassword, machine.FieldIpAddress, machine.FieldScenarios, machine.FieldVersion, machine.FieldStatus, machine.FieldAuthType, machine.FieldOsname, machine.FieldOsversion, machine.FieldFeatureflags: + case machine.FieldMachineId, machine.FieldPassword, machine.FieldIpAddress, machine.FieldScenarios, machine.FieldVersion, machine.FieldAuthType, machine.FieldOsname, machine.FieldOsversion, machine.FieldFeatureflags: values[i] = new(sql.NullString) case machine.FieldCreatedAt, machine.FieldUpdatedAt, machine.FieldLastPush, machine.FieldLastHeartbeat: values[i] = new(sql.NullTime) @@ -175,12 +173,6 @@ func (m *Machine) assignValues(columns []string, values []any) error { } else if value.Valid { m.IsValidated = value.Bool } - case machine.FieldStatus: - if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field status", values[i]) - } else if value.Valid { - m.Status = value.String - } case machine.FieldAuthType: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field auth_type", values[i]) @@ -295,9 +287,6 @@ func (m *Machine) String() string { builder.WriteString("isValidated=") builder.WriteString(fmt.Sprintf("%v", m.IsValidated)) builder.WriteString(", ") - builder.WriteString("status=") - builder.WriteString(m.Status) - builder.WriteString(", ") builder.WriteString("auth_type=") builder.WriteString(m.AuthType) builder.WriteString(", ") diff --git a/pkg/database/ent/machine/machine.go b/pkg/database/ent/machine/machine.go index 179059edd4d..009e6e19c35 100644 --- a/pkg/database/ent/machine/machine.go +++ b/pkg/database/ent/machine/machine.go @@ -34,8 +34,6 @@ const ( FieldVersion = "version" // FieldIsValidated holds the string denoting the isvalidated field in the database. FieldIsValidated = "is_validated" - // FieldStatus holds the string denoting the status field in the database. - FieldStatus = "status" // FieldAuthType holds the string denoting the auth_type field in the database. FieldAuthType = "auth_type" // FieldOsname holds the string denoting the osname field in the database. @@ -74,7 +72,6 @@ var Columns = []string{ FieldScenarios, FieldVersion, FieldIsValidated, - FieldStatus, FieldAuthType, FieldOsname, FieldOsversion, @@ -168,11 +165,6 @@ func ByIsValidated(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldIsValidated, opts...).ToFunc() } -// ByStatus orders the results by the status field. -func ByStatus(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldStatus, opts...).ToFunc() -} - // ByAuthType orders the results by the auth_type field. func ByAuthType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAuthType, opts...).ToFunc() diff --git a/pkg/database/ent/machine/where.go b/pkg/database/ent/machine/where.go index aca66135f5c..de523510f33 100644 --- a/pkg/database/ent/machine/where.go +++ b/pkg/database/ent/machine/where.go @@ -105,11 +105,6 @@ func IsValidated(v bool) predicate.Machine { return predicate.Machine(sql.FieldEQ(FieldIsValidated, v)) } -// Status applies equality check predicate on the "status" field. It's identical to StatusEQ. -func Status(v string) predicate.Machine { - return predicate.Machine(sql.FieldEQ(FieldStatus, v)) -} - // AuthType applies equality check predicate on the "auth_type" field. It's identical to AuthTypeEQ. func AuthType(v string) predicate.Machine { return predicate.Machine(sql.FieldEQ(FieldAuthType, v)) @@ -665,81 +660,6 @@ func IsValidatedNEQ(v bool) predicate.Machine { return predicate.Machine(sql.FieldNEQ(FieldIsValidated, v)) } -// StatusEQ applies the EQ predicate on the "status" field. -func StatusEQ(v string) predicate.Machine { - return predicate.Machine(sql.FieldEQ(FieldStatus, v)) -} - -// StatusNEQ applies the NEQ predicate on the "status" field. -func StatusNEQ(v string) predicate.Machine { - return predicate.Machine(sql.FieldNEQ(FieldStatus, v)) -} - -// StatusIn applies the In predicate on the "status" field. -func StatusIn(vs ...string) predicate.Machine { - return predicate.Machine(sql.FieldIn(FieldStatus, vs...)) -} - -// StatusNotIn applies the NotIn predicate on the "status" field. -func StatusNotIn(vs ...string) predicate.Machine { - return predicate.Machine(sql.FieldNotIn(FieldStatus, vs...)) -} - -// StatusGT applies the GT predicate on the "status" field. -func StatusGT(v string) predicate.Machine { - return predicate.Machine(sql.FieldGT(FieldStatus, v)) -} - -// StatusGTE applies the GTE predicate on the "status" field. -func StatusGTE(v string) predicate.Machine { - return predicate.Machine(sql.FieldGTE(FieldStatus, v)) -} - -// StatusLT applies the LT predicate on the "status" field. -func StatusLT(v string) predicate.Machine { - return predicate.Machine(sql.FieldLT(FieldStatus, v)) -} - -// StatusLTE applies the LTE predicate on the "status" field. -func StatusLTE(v string) predicate.Machine { - return predicate.Machine(sql.FieldLTE(FieldStatus, v)) -} - -// StatusContains applies the Contains predicate on the "status" field. -func StatusContains(v string) predicate.Machine { - return predicate.Machine(sql.FieldContains(FieldStatus, v)) -} - -// StatusHasPrefix applies the HasPrefix predicate on the "status" field. -func StatusHasPrefix(v string) predicate.Machine { - return predicate.Machine(sql.FieldHasPrefix(FieldStatus, v)) -} - -// StatusHasSuffix applies the HasSuffix predicate on the "status" field. -func StatusHasSuffix(v string) predicate.Machine { - return predicate.Machine(sql.FieldHasSuffix(FieldStatus, v)) -} - -// StatusIsNil applies the IsNil predicate on the "status" field. -func StatusIsNil() predicate.Machine { - return predicate.Machine(sql.FieldIsNull(FieldStatus)) -} - -// StatusNotNil applies the NotNil predicate on the "status" field. -func StatusNotNil() predicate.Machine { - return predicate.Machine(sql.FieldNotNull(FieldStatus)) -} - -// StatusEqualFold applies the EqualFold predicate on the "status" field. -func StatusEqualFold(v string) predicate.Machine { - return predicate.Machine(sql.FieldEqualFold(FieldStatus, v)) -} - -// StatusContainsFold applies the ContainsFold predicate on the "status" field. -func StatusContainsFold(v string) predicate.Machine { - return predicate.Machine(sql.FieldContainsFold(FieldStatus, v)) -} - // AuthTypeEQ applies the EQ predicate on the "auth_type" field. func AuthTypeEQ(v string) predicate.Machine { return predicate.Machine(sql.FieldEQ(FieldAuthType, v)) diff --git a/pkg/database/ent/machine_create.go b/pkg/database/ent/machine_create.go index 4ae0e5a9d1f..a68f7a23966 100644 --- a/pkg/database/ent/machine_create.go +++ b/pkg/database/ent/machine_create.go @@ -138,20 +138,6 @@ func (mc *MachineCreate) SetNillableIsValidated(b *bool) *MachineCreate { return mc } -// SetStatus sets the "status" field. -func (mc *MachineCreate) SetStatus(s string) *MachineCreate { - mc.mutation.SetStatus(s) - return mc -} - -// SetNillableStatus sets the "status" field if the given value is not nil. -func (mc *MachineCreate) SetNillableStatus(s *string) *MachineCreate { - if s != nil { - mc.SetStatus(*s) - } - return mc -} - // SetAuthType sets the "auth_type" field. func (mc *MachineCreate) SetAuthType(s string) *MachineCreate { mc.mutation.SetAuthType(s) @@ -386,10 +372,6 @@ func (mc *MachineCreate) createSpec() (*Machine, *sqlgraph.CreateSpec) { _spec.SetField(machine.FieldIsValidated, field.TypeBool, value) _node.IsValidated = value } - if value, ok := mc.mutation.Status(); ok { - _spec.SetField(machine.FieldStatus, field.TypeString, value) - _node.Status = value - } if value, ok := mc.mutation.AuthType(); ok { _spec.SetField(machine.FieldAuthType, field.TypeString, value) _node.AuthType = value diff --git a/pkg/database/ent/machine_update.go b/pkg/database/ent/machine_update.go index aa0f02542c1..c9a4f0b72ff 100644 --- a/pkg/database/ent/machine_update.go +++ b/pkg/database/ent/machine_update.go @@ -158,26 +158,6 @@ func (mu *MachineUpdate) SetNillableIsValidated(b *bool) *MachineUpdate { return mu } -// SetStatus sets the "status" field. -func (mu *MachineUpdate) SetStatus(s string) *MachineUpdate { - mu.mutation.SetStatus(s) - return mu -} - -// SetNillableStatus sets the "status" field if the given value is not nil. -func (mu *MachineUpdate) SetNillableStatus(s *string) *MachineUpdate { - if s != nil { - mu.SetStatus(*s) - } - return mu -} - -// ClearStatus clears the value of the "status" field. -func (mu *MachineUpdate) ClearStatus() *MachineUpdate { - mu.mutation.ClearStatus() - return mu -} - // SetAuthType sets the "auth_type" field. func (mu *MachineUpdate) SetAuthType(s string) *MachineUpdate { mu.mutation.SetAuthType(s) @@ -411,12 +391,6 @@ func (mu *MachineUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := mu.mutation.IsValidated(); ok { _spec.SetField(machine.FieldIsValidated, field.TypeBool, value) } - if value, ok := mu.mutation.Status(); ok { - _spec.SetField(machine.FieldStatus, field.TypeString, value) - } - if mu.mutation.StatusCleared() { - _spec.ClearField(machine.FieldStatus, field.TypeString) - } if value, ok := mu.mutation.AuthType(); ok { _spec.SetField(machine.FieldAuthType, field.TypeString, value) } @@ -643,26 +617,6 @@ func (muo *MachineUpdateOne) SetNillableIsValidated(b *bool) *MachineUpdateOne { return muo } -// SetStatus sets the "status" field. -func (muo *MachineUpdateOne) SetStatus(s string) *MachineUpdateOne { - muo.mutation.SetStatus(s) - return muo -} - -// SetNillableStatus sets the "status" field if the given value is not nil. -func (muo *MachineUpdateOne) SetNillableStatus(s *string) *MachineUpdateOne { - if s != nil { - muo.SetStatus(*s) - } - return muo -} - -// ClearStatus clears the value of the "status" field. -func (muo *MachineUpdateOne) ClearStatus() *MachineUpdateOne { - muo.mutation.ClearStatus() - return muo -} - // SetAuthType sets the "auth_type" field. func (muo *MachineUpdateOne) SetAuthType(s string) *MachineUpdateOne { muo.mutation.SetAuthType(s) @@ -926,12 +880,6 @@ func (muo *MachineUpdateOne) sqlSave(ctx context.Context) (_node *Machine, err e if value, ok := muo.mutation.IsValidated(); ok { _spec.SetField(machine.FieldIsValidated, field.TypeBool, value) } - if value, ok := muo.mutation.Status(); ok { - _spec.SetField(machine.FieldStatus, field.TypeString, value) - } - if muo.mutation.StatusCleared() { - _spec.ClearField(machine.FieldStatus, field.TypeString) - } if value, ok := muo.mutation.AuthType(); ok { _spec.SetField(machine.FieldAuthType, field.TypeString, value) } diff --git a/pkg/database/ent/migrate/schema.go b/pkg/database/ent/migrate/schema.go index 5c32c472403..5b436830192 100644 --- a/pkg/database/ent/migrate/schema.go +++ b/pkg/database/ent/migrate/schema.go @@ -205,7 +205,6 @@ var ( {Name: "scenarios", Type: field.TypeString, Nullable: true, Size: 100000}, {Name: "version", Type: field.TypeString, Nullable: true}, {Name: "is_validated", Type: field.TypeBool, Default: false}, - {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "auth_type", Type: field.TypeString, Default: "password"}, {Name: "osname", Type: field.TypeString, Nullable: true}, {Name: "osversion", Type: field.TypeString, Nullable: true}, diff --git a/pkg/database/ent/mutation.go b/pkg/database/ent/mutation.go index 8d109ece379..045ecb3c9af 100644 --- a/pkg/database/ent/mutation.go +++ b/pkg/database/ent/mutation.go @@ -6538,7 +6538,6 @@ type MachineMutation struct { scenarios *string version *string isValidated *bool - status *string auth_type *string osname *string osversion *string @@ -7064,55 +7063,6 @@ func (m *MachineMutation) ResetIsValidated() { m.isValidated = nil } -// SetStatus sets the "status" field. -func (m *MachineMutation) SetStatus(s string) { - m.status = &s -} - -// Status returns the value of the "status" field in the mutation. -func (m *MachineMutation) Status() (r string, exists bool) { - v := m.status - if v == nil { - return - } - return *v, true -} - -// OldStatus returns the old "status" field's value of the Machine entity. -// If the Machine 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 *MachineMutation) OldStatus(ctx context.Context) (v string, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldStatus is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldStatus requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldStatus: %w", err) - } - return oldValue.Status, nil -} - -// ClearStatus clears the value of the "status" field. -func (m *MachineMutation) ClearStatus() { - m.status = nil - m.clearedFields[machine.FieldStatus] = struct{}{} -} - -// StatusCleared returns if the "status" field was cleared in this mutation. -func (m *MachineMutation) StatusCleared() bool { - _, ok := m.clearedFields[machine.FieldStatus] - return ok -} - -// ResetStatus resets all changes to the "status" field. -func (m *MachineMutation) ResetStatus() { - m.status = nil - delete(m.clearedFields, machine.FieldStatus) -} - // SetAuthType sets the "auth_type" field. func (m *MachineMutation) SetAuthType(s string) { m.auth_type = &s @@ -7482,7 +7432,7 @@ func (m *MachineMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *MachineMutation) Fields() []string { - fields := make([]string, 0, 17) + fields := make([]string, 0, 16) if m.created_at != nil { fields = append(fields, machine.FieldCreatedAt) } @@ -7513,9 +7463,6 @@ func (m *MachineMutation) Fields() []string { if m.isValidated != nil { fields = append(fields, machine.FieldIsValidated) } - if m.status != nil { - fields = append(fields, machine.FieldStatus) - } if m.auth_type != nil { fields = append(fields, machine.FieldAuthType) } @@ -7562,8 +7509,6 @@ func (m *MachineMutation) Field(name string) (ent.Value, bool) { return m.Version() case machine.FieldIsValidated: return m.IsValidated() - case machine.FieldStatus: - return m.Status() case machine.FieldAuthType: return m.AuthType() case machine.FieldOsname: @@ -7605,8 +7550,6 @@ func (m *MachineMutation) OldField(ctx context.Context, name string) (ent.Value, return m.OldVersion(ctx) case machine.FieldIsValidated: return m.OldIsValidated(ctx) - case machine.FieldStatus: - return m.OldStatus(ctx) case machine.FieldAuthType: return m.OldAuthType(ctx) case machine.FieldOsname: @@ -7698,13 +7641,6 @@ func (m *MachineMutation) SetField(name string, value ent.Value) error { } m.SetIsValidated(v) return nil - case machine.FieldStatus: - v, ok := value.(string) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetStatus(v) - return nil case machine.FieldAuthType: v, ok := value.(string) if !ok { @@ -7789,9 +7725,6 @@ func (m *MachineMutation) ClearedFields() []string { if m.FieldCleared(machine.FieldVersion) { fields = append(fields, machine.FieldVersion) } - if m.FieldCleared(machine.FieldStatus) { - fields = append(fields, machine.FieldStatus) - } if m.FieldCleared(machine.FieldOsname) { fields = append(fields, machine.FieldOsname) } @@ -7833,9 +7766,6 @@ func (m *MachineMutation) ClearField(name string) error { case machine.FieldVersion: m.ClearVersion() return nil - case machine.FieldStatus: - m.ClearStatus() - return nil case machine.FieldOsname: m.ClearOsname() return nil @@ -7889,9 +7819,6 @@ func (m *MachineMutation) ResetField(name string) error { case machine.FieldIsValidated: m.ResetIsValidated() return nil - case machine.FieldStatus: - m.ResetStatus() - return nil case machine.FieldAuthType: m.ResetAuthType() return nil diff --git a/pkg/database/ent/runtime.go b/pkg/database/ent/runtime.go index 8d50d916029..15413490633 100644 --- a/pkg/database/ent/runtime.go +++ b/pkg/database/ent/runtime.go @@ -151,7 +151,7 @@ func init() { // machine.DefaultIsValidated holds the default value on creation for the isValidated field. machine.DefaultIsValidated = machineDescIsValidated.Default.(bool) // machineDescAuthType is the schema descriptor for auth_type field. - machineDescAuthType := machineFields[11].Descriptor() + machineDescAuthType := machineFields[10].Descriptor() // machine.DefaultAuthType holds the default value on creation for the auth_type field. machine.DefaultAuthType = machineDescAuthType.Default.(string) metaFields := schema.Meta{}.Fields() diff --git a/pkg/database/ent/schema/machine.go b/pkg/database/ent/schema/machine.go index 6fdcea2d824..071586f0c84 100644 --- a/pkg/database/ent/schema/machine.go +++ b/pkg/database/ent/schema/machine.go @@ -42,7 +42,6 @@ func (Machine) Fields() []ent.Field { field.String("version").Optional(), field.Bool("isValidated"). Default(false), - field.String("status").Optional(), field.String("auth_type").Default(types.PasswordAuthType).StructTag(`json:"auth_type"`), field.String("osname").Optional(), field.String("osversion").Optional(),