123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- // Code generated by ent, DO NOT EDIT.
- package tasklog
- import (
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
- // Label holds the string label denoting the tasklog type in the database.
- Label = "task_log"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "id"
- // FieldStartedAt holds the string denoting the started_at field in the database.
- FieldStartedAt = "started_at"
- // FieldFinishedAt holds the string denoting the finished_at field in the database.
- FieldFinishedAt = "finished_at"
- // FieldResult holds the string denoting the result field in the database.
- FieldResult = "result"
- // EdgeTasks holds the string denoting the tasks edge name in mutations.
- EdgeTasks = "tasks"
- // Table holds the table name of the tasklog in the database.
- Table = "sys_task_logs"
- // TasksTable is the table that holds the tasks relation/edge.
- TasksTable = "sys_task_logs"
- // TasksInverseTable is the table name for the Task entity.
- // It exists in this package in order to avoid circular dependency with the "task" package.
- TasksInverseTable = "sys_tasks"
- // TasksColumn is the table column denoting the tasks relation/edge.
- TasksColumn = "task_task_logs"
- )
- // Columns holds all SQL columns for tasklog fields.
- var Columns = []string{
- FieldID,
- FieldStartedAt,
- FieldFinishedAt,
- FieldResult,
- }
- // ForeignKeys holds the SQL foreign-keys that are owned by the "sys_task_logs"
- // table and are not defined as standalone fields in the schema.
- var ForeignKeys = []string{
- "task_task_logs",
- }
- // ValidColumn reports if the column name is valid (part of the table columns).
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- for i := range ForeignKeys {
- if column == ForeignKeys[i] {
- return true
- }
- }
- return false
- }
- var (
- // DefaultStartedAt holds the default value on creation for the "started_at" field.
- DefaultStartedAt func() time.Time
- )
- // OrderOption defines the ordering options for the TaskLog queries.
- type OrderOption func(*sql.Selector)
- // ByID orders the results by the id field.
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- // ByStartedAt orders the results by the started_at field.
- func ByStartedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStartedAt, opts...).ToFunc()
- }
- // ByFinishedAt orders the results by the finished_at field.
- func ByFinishedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldFinishedAt, opts...).ToFunc()
- }
- // ByResult orders the results by the result field.
- func ByResult(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldResult, opts...).ToFunc()
- }
- // ByTasksField orders the results by tasks field.
- func ByTasksField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newTasksStep(), sql.OrderByField(field, opts...))
- }
- }
- func newTasksStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(TasksInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, TasksTable, TasksColumn),
- )
- }
|