github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/cron_job.go (about)

     1  package models
     2  
     3  import (
     4  	"github.com/machinefi/w3bstream/pkg/depends/base/types"
     5  	"github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes"
     6  )
     7  
     8  // CronJob schema for cron job information
     9  // @def primary                      ID
    10  // @def unique_index UI_cron_job_id  CronJobID
    11  // @def unique_index UI_cron         ProjectID CronExpressions EventType
    12  //
    13  //go:generate toolkit gen model CronJob --database DB
    14  type CronJob struct {
    15  	datatypes.PrimaryID
    16  	RelCronJob
    17  	RelProject
    18  	CronJobInfo
    19  	datatypes.OperationTimesWithDeleted
    20  }
    21  
    22  type RelCronJob struct {
    23  	CronJobID types.SFID `db:"f_cron_job_id" json:"cronJobID"`
    24  }
    25  
    26  type CronJobInfo struct {
    27  	CronExpressions string `db:"f_cron_expressions"    json:"cronExpressions"`
    28  	EventType       string `db:"f_event_type"          json:"eventType,omitempty"`
    29  }