contactfield.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // Code generated by ent, DO NOT EDIT.
  2. package contactfield
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. "entgo.io/ent/dialect/sql/sqlgraph"
  8. )
  9. const (
  10. // Label holds the string label denoting the contactfield type in the database.
  11. Label = "contact_field"
  12. // FieldID holds the string denoting the id field in the database.
  13. FieldID = "id"
  14. // FieldCreatedAt holds the string denoting the created_at field in the database.
  15. FieldCreatedAt = "created_at"
  16. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  17. FieldUpdatedAt = "updated_at"
  18. // FieldStatus holds the string denoting the status field in the database.
  19. FieldStatus = "status"
  20. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  21. FieldDeletedAt = "deleted_at"
  22. // FieldContactID holds the string denoting the contact_id field in the database.
  23. FieldContactID = "contact_id"
  24. // FieldFormID holds the string denoting the form_id field in the database.
  25. FieldFormID = "form_id"
  26. // FieldValue holds the string denoting the value field in the database.
  27. FieldValue = "value"
  28. // EdgeFieldContact holds the string denoting the field_contact edge name in mutations.
  29. EdgeFieldContact = "field_contact"
  30. // Table holds the table name of the contactfield in the database.
  31. Table = "contact_field"
  32. // FieldContactTable is the table that holds the field_contact relation/edge.
  33. FieldContactTable = "contact_field"
  34. // FieldContactInverseTable is the table name for the Contact entity.
  35. // It exists in this package in order to avoid circular dependency with the "contact" package.
  36. FieldContactInverseTable = "contact"
  37. // FieldContactColumn is the table column denoting the field_contact relation/edge.
  38. FieldContactColumn = "contact_id"
  39. )
  40. // Columns holds all SQL columns for contactfield fields.
  41. var Columns = []string{
  42. FieldID,
  43. FieldCreatedAt,
  44. FieldUpdatedAt,
  45. FieldStatus,
  46. FieldDeletedAt,
  47. FieldContactID,
  48. FieldFormID,
  49. FieldValue,
  50. }
  51. // ValidColumn reports if the column name is valid (part of the table columns).
  52. func ValidColumn(column string) bool {
  53. for i := range Columns {
  54. if column == Columns[i] {
  55. return true
  56. }
  57. }
  58. return false
  59. }
  60. // Note that the variables below are initialized by the runtime
  61. // package on the initialization of the application. Therefore,
  62. // it should be imported in the main as follows:
  63. //
  64. // import _ "wechat-api/ent/runtime"
  65. var (
  66. Hooks [1]ent.Hook
  67. Interceptors [1]ent.Interceptor
  68. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  69. DefaultCreatedAt func() time.Time
  70. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  71. DefaultUpdatedAt func() time.Time
  72. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  73. UpdateDefaultUpdatedAt func() time.Time
  74. // DefaultStatus holds the default value on creation for the "status" field.
  75. DefaultStatus uint8
  76. // DefaultContactID holds the default value on creation for the "contact_id" field.
  77. DefaultContactID uint64
  78. )
  79. // OrderOption defines the ordering options for the ContactField queries.
  80. type OrderOption func(*sql.Selector)
  81. // ByID orders the results by the id field.
  82. func ByID(opts ...sql.OrderTermOption) OrderOption {
  83. return sql.OrderByField(FieldID, opts...).ToFunc()
  84. }
  85. // ByCreatedAt orders the results by the created_at field.
  86. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  87. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  88. }
  89. // ByUpdatedAt orders the results by the updated_at field.
  90. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  91. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  92. }
  93. // ByStatus orders the results by the status field.
  94. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  95. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  96. }
  97. // ByDeletedAt orders the results by the deleted_at field.
  98. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  99. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  100. }
  101. // ByContactID orders the results by the contact_id field.
  102. func ByContactID(opts ...sql.OrderTermOption) OrderOption {
  103. return sql.OrderByField(FieldContactID, opts...).ToFunc()
  104. }
  105. // ByFormID orders the results by the form_id field.
  106. func ByFormID(opts ...sql.OrderTermOption) OrderOption {
  107. return sql.OrderByField(FieldFormID, opts...).ToFunc()
  108. }
  109. // ByFieldContactField orders the results by field_contact field.
  110. func ByFieldContactField(field string, opts ...sql.OrderTermOption) OrderOption {
  111. return func(s *sql.Selector) {
  112. sqlgraph.OrderByNeighborTerms(s, newFieldContactStep(), sql.OrderByField(field, opts...))
  113. }
  114. }
  115. func newFieldContactStep() *sqlgraph.Step {
  116. return sqlgraph.NewStep(
  117. sqlgraph.From(Table, FieldID),
  118. sqlgraph.To(FieldContactInverseTable, FieldID),
  119. sqlgraph.Edge(sqlgraph.M2O, true, FieldContactTable, FieldContactColumn),
  120. )
  121. }