forked from mirrors/homebox
feat: add scheduled maintenance tasks (#320)
* add scheduled maintenance tasks * fix failing typecheck
This commit is contained in:
parent
70297b9d27
commit
025521431e
25 changed files with 521 additions and 121 deletions
|
@ -21,6 +21,8 @@ const (
|
|||
FieldItemID = "item_id"
|
||||
// FieldDate holds the string denoting the date field in the database.
|
||||
FieldDate = "date"
|
||||
// FieldScheduledDate holds the string denoting the scheduled_date field in the database.
|
||||
FieldScheduledDate = "scheduled_date"
|
||||
// FieldName holds the string denoting the name field in the database.
|
||||
FieldName = "name"
|
||||
// FieldDescription holds the string denoting the description field in the database.
|
||||
|
@ -47,6 +49,7 @@ var Columns = []string{
|
|||
FieldUpdatedAt,
|
||||
FieldItemID,
|
||||
FieldDate,
|
||||
FieldScheduledDate,
|
||||
FieldName,
|
||||
FieldDescription,
|
||||
FieldCost,
|
||||
|
@ -69,8 +72,6 @@ var (
|
|||
DefaultUpdatedAt func() time.Time
|
||||
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
||||
UpdateDefaultUpdatedAt func() time.Time
|
||||
// DefaultDate holds the default value on creation for the "date" field.
|
||||
DefaultDate func() time.Time
|
||||
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
NameValidator func(string) error
|
||||
// DescriptionValidator is a validator for the "description" field. It is called by the builders before save.
|
||||
|
|
|
@ -76,6 +76,11 @@ func Date(v time.Time) predicate.MaintenanceEntry {
|
|||
return predicate.MaintenanceEntry(sql.FieldEQ(FieldDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDate applies equality check predicate on the "scheduled_date" field. It's identical to ScheduledDateEQ.
|
||||
func ScheduledDate(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldEQ(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
||||
func Name(v string) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldEQ(FieldName, v))
|
||||
|
@ -231,6 +236,66 @@ func DateLTE(v time.Time) predicate.MaintenanceEntry {
|
|||
return predicate.MaintenanceEntry(sql.FieldLTE(FieldDate, v))
|
||||
}
|
||||
|
||||
// DateIsNil applies the IsNil predicate on the "date" field.
|
||||
func DateIsNil() predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldIsNull(FieldDate))
|
||||
}
|
||||
|
||||
// DateNotNil applies the NotNil predicate on the "date" field.
|
||||
func DateNotNil() predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldNotNull(FieldDate))
|
||||
}
|
||||
|
||||
// ScheduledDateEQ applies the EQ predicate on the "scheduled_date" field.
|
||||
func ScheduledDateEQ(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldEQ(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDateNEQ applies the NEQ predicate on the "scheduled_date" field.
|
||||
func ScheduledDateNEQ(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldNEQ(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDateIn applies the In predicate on the "scheduled_date" field.
|
||||
func ScheduledDateIn(vs ...time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldIn(FieldScheduledDate, vs...))
|
||||
}
|
||||
|
||||
// ScheduledDateNotIn applies the NotIn predicate on the "scheduled_date" field.
|
||||
func ScheduledDateNotIn(vs ...time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldNotIn(FieldScheduledDate, vs...))
|
||||
}
|
||||
|
||||
// ScheduledDateGT applies the GT predicate on the "scheduled_date" field.
|
||||
func ScheduledDateGT(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldGT(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDateGTE applies the GTE predicate on the "scheduled_date" field.
|
||||
func ScheduledDateGTE(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldGTE(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDateLT applies the LT predicate on the "scheduled_date" field.
|
||||
func ScheduledDateLT(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldLT(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDateLTE applies the LTE predicate on the "scheduled_date" field.
|
||||
func ScheduledDateLTE(v time.Time) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldLTE(FieldScheduledDate, v))
|
||||
}
|
||||
|
||||
// ScheduledDateIsNil applies the IsNil predicate on the "scheduled_date" field.
|
||||
func ScheduledDateIsNil() predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldIsNull(FieldScheduledDate))
|
||||
}
|
||||
|
||||
// ScheduledDateNotNil applies the NotNil predicate on the "scheduled_date" field.
|
||||
func ScheduledDateNotNil() predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldNotNull(FieldScheduledDate))
|
||||
}
|
||||
|
||||
// NameEQ applies the EQ predicate on the "name" field.
|
||||
func NameEQ(v string) predicate.MaintenanceEntry {
|
||||
return predicate.MaintenanceEntry(sql.FieldEQ(FieldName, v))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue