123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- package labelrelationship
- import (
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "label_relationship"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldStatus = "status"
-
- FieldLabelID = "label_id"
-
- FieldContactID = "contact_id"
-
- FieldOrganizationID = "organization_id"
-
- EdgeContacts = "contacts"
-
- EdgeLabels = "labels"
-
- Table = "label_relationship"
-
- ContactsTable = "label_relationship"
-
-
- ContactsInverseTable = "contact"
-
- ContactsColumn = "contact_id"
-
- LabelsTable = "label_relationship"
-
-
- LabelsInverseTable = "label"
-
- LabelsColumn = "label_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldLabelID,
- FieldContactID,
- FieldOrganizationID,
- }
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
-
- DefaultCreatedAt func() time.Time
-
- DefaultUpdatedAt func() time.Time
-
- UpdateDefaultUpdatedAt func() time.Time
-
- DefaultStatus uint8
-
- DefaultLabelID uint64
-
- DefaultContactID uint64
-
- DefaultOrganizationID uint64
- )
- type OrderOption func(*sql.Selector)
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- func ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- func ByLabelID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLabelID, opts...).ToFunc()
- }
- func ByContactID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContactID, opts...).ToFunc()
- }
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- func ByContactsField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newContactsStep(), sql.OrderByField(field, opts...))
- }
- }
- func ByLabelsField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newLabelsStep(), sql.OrderByField(field, opts...))
- }
- }
- func newContactsStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(ContactsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, ContactsTable, ContactsColumn),
- )
- }
- func newLabelsStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(LabelsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, LabelsTable, LabelsColumn),
- )
- }
|