labellog.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Code generated by ent, DO NOT EDIT.
  2. package labellog
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the labellog type in the database.
  9. Label = "label_log"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldCreatedAt holds the string denoting the created_at field in the database.
  13. FieldCreatedAt = "created_at"
  14. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  15. FieldUpdatedAt = "updated_at"
  16. // FieldLabelName holds the string denoting the label_name field in the database.
  17. FieldLabelName = "label_name"
  18. // FieldLabelID holds the string denoting the label_id field in the database.
  19. FieldLabelID = "label_id"
  20. // FieldWxID holds the string denoting the wx_id field in the database.
  21. FieldWxID = "wx_id"
  22. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  23. FieldOrganizationID = "organization_id"
  24. // Table holds the table name of the labellog in the database.
  25. Table = "label_log"
  26. )
  27. // Columns holds all SQL columns for labellog fields.
  28. var Columns = []string{
  29. FieldID,
  30. FieldCreatedAt,
  31. FieldUpdatedAt,
  32. FieldLabelName,
  33. FieldLabelID,
  34. FieldWxID,
  35. FieldOrganizationID,
  36. }
  37. // ValidColumn reports if the column name is valid (part of the table columns).
  38. func ValidColumn(column string) bool {
  39. for i := range Columns {
  40. if column == Columns[i] {
  41. return true
  42. }
  43. }
  44. return false
  45. }
  46. var (
  47. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  48. DefaultCreatedAt func() time.Time
  49. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  50. DefaultUpdatedAt func() time.Time
  51. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  52. UpdateDefaultUpdatedAt func() time.Time
  53. // DefaultLabelName holds the default value on creation for the "label_name" field.
  54. DefaultLabelName string
  55. // DefaultLabelID holds the default value on creation for the "label_id" field.
  56. DefaultLabelID int
  57. // DefaultWxID holds the default value on creation for the "wx_id" field.
  58. DefaultWxID string
  59. // DefaultOrganizationID holds the default value on creation for the "organization_id" field.
  60. DefaultOrganizationID uint64
  61. )
  62. // OrderOption defines the ordering options for the LabelLog queries.
  63. type OrderOption func(*sql.Selector)
  64. // ByID orders the results by the id field.
  65. func ByID(opts ...sql.OrderTermOption) OrderOption {
  66. return sql.OrderByField(FieldID, opts...).ToFunc()
  67. }
  68. // ByCreatedAt orders the results by the created_at field.
  69. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  70. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  71. }
  72. // ByUpdatedAt orders the results by the updated_at field.
  73. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  74. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  75. }
  76. // ByLabelName orders the results by the label_name field.
  77. func ByLabelName(opts ...sql.OrderTermOption) OrderOption {
  78. return sql.OrderByField(FieldLabelName, opts...).ToFunc()
  79. }
  80. // ByLabelID orders the results by the label_id field.
  81. func ByLabelID(opts ...sql.OrderTermOption) OrderOption {
  82. return sql.OrderByField(FieldLabelID, opts...).ToFunc()
  83. }
  84. // ByWxID orders the results by the wx_id field.
  85. func ByWxID(opts ...sql.OrderTermOption) OrderOption {
  86. return sql.OrderByField(FieldWxID, opts...).ToFunc()
  87. }
  88. // ByOrganizationID orders the results by the organization_id field.
  89. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  90. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  91. }