-
Notifications
You must be signed in to change notification settings - Fork 25
/
workflowcontract.go
168 lines (150 loc) · 6 KB
/
workflowcontract.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Code generated by ent, DO NOT EDIT.
package workflowcontract
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/google/uuid"
)
const (
// Label holds the string label denoting the workflowcontract type in the database.
Label = "workflow_contract"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// EdgeVersions holds the string denoting the versions edge name in mutations.
EdgeVersions = "versions"
// EdgeOrganization holds the string denoting the organization edge name in mutations.
EdgeOrganization = "organization"
// EdgeWorkflows holds the string denoting the workflows edge name in mutations.
EdgeWorkflows = "workflows"
// Table holds the table name of the workflowcontract in the database.
Table = "workflow_contracts"
// VersionsTable is the table that holds the versions relation/edge.
VersionsTable = "workflow_contract_versions"
// VersionsInverseTable is the table name for the WorkflowContractVersion entity.
// It exists in this package in order to avoid circular dependency with the "workflowcontractversion" package.
VersionsInverseTable = "workflow_contract_versions"
// VersionsColumn is the table column denoting the versions relation/edge.
VersionsColumn = "workflow_contract_versions"
// OrganizationTable is the table that holds the organization relation/edge.
OrganizationTable = "workflow_contracts"
// OrganizationInverseTable is the table name for the Organization entity.
// It exists in this package in order to avoid circular dependency with the "organization" package.
OrganizationInverseTable = "organizations"
// OrganizationColumn is the table column denoting the organization relation/edge.
OrganizationColumn = "organization_workflow_contracts"
// WorkflowsTable is the table that holds the workflows relation/edge.
WorkflowsTable = "workflows"
// WorkflowsInverseTable is the table name for the Workflow entity.
// It exists in this package in order to avoid circular dependency with the "workflow" package.
WorkflowsInverseTable = "workflows"
// WorkflowsColumn is the table column denoting the workflows relation/edge.
WorkflowsColumn = "workflow_contract"
)
// Columns holds all SQL columns for workflowcontract fields.
var Columns = []string{
FieldID,
FieldName,
FieldCreatedAt,
FieldDeletedAt,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "workflow_contracts"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"organization_workflow_contracts",
}
// 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 (
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
// OrderOption defines the ordering options for the WorkflowContract 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()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByVersionsCount orders the results by versions count.
func ByVersionsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newVersionsStep(), opts...)
}
}
// ByVersions orders the results by versions terms.
func ByVersions(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newVersionsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByOrganizationField orders the results by organization field.
func ByOrganizationField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), sql.OrderByField(field, opts...))
}
}
// ByWorkflowsCount orders the results by workflows count.
func ByWorkflowsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newWorkflowsStep(), opts...)
}
}
// ByWorkflows orders the results by workflows terms.
func ByWorkflows(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newWorkflowsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newVersionsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(VersionsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, VersionsTable, VersionsColumn),
)
}
func newOrganizationStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(OrganizationInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, OrganizationTable, OrganizationColumn),
)
}
func newWorkflowsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(WorkflowsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, WorkflowsTable, WorkflowsColumn),
)
}