identityadoptiondecision.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. // Code generated by ent, DO NOT EDIT.
  2. package identityadoptiondecision
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. )
  8. const (
  9. // Label holds the string label denoting the identityadoptiondecision type in the database.
  10. Label = "identity_adoption_decision"
  11. // FieldID holds the string denoting the id field in the database.
  12. FieldID = "id"
  13. // FieldCreatedAt holds the string denoting the created_at field in the database.
  14. FieldCreatedAt = "created_at"
  15. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  16. FieldUpdatedAt = "updated_at"
  17. // FieldPendingAuthSessionID holds the string denoting the pending_auth_session_id field in the database.
  18. FieldPendingAuthSessionID = "pending_auth_session_id"
  19. // FieldIdentityID holds the string denoting the identity_id field in the database.
  20. FieldIdentityID = "identity_id"
  21. // FieldAdoptDisplayName holds the string denoting the adopt_display_name field in the database.
  22. FieldAdoptDisplayName = "adopt_display_name"
  23. // FieldAdoptAvatar holds the string denoting the adopt_avatar field in the database.
  24. FieldAdoptAvatar = "adopt_avatar"
  25. // FieldDecidedAt holds the string denoting the decided_at field in the database.
  26. FieldDecidedAt = "decided_at"
  27. // EdgePendingAuthSession holds the string denoting the pending_auth_session edge name in mutations.
  28. EdgePendingAuthSession = "pending_auth_session"
  29. // EdgeIdentity holds the string denoting the identity edge name in mutations.
  30. EdgeIdentity = "identity"
  31. // Table holds the table name of the identityadoptiondecision in the database.
  32. Table = "identity_adoption_decisions"
  33. // PendingAuthSessionTable is the table that holds the pending_auth_session relation/edge.
  34. PendingAuthSessionTable = "identity_adoption_decisions"
  35. // PendingAuthSessionInverseTable is the table name for the PendingAuthSession entity.
  36. // It exists in this package in order to avoid circular dependency with the "pendingauthsession" package.
  37. PendingAuthSessionInverseTable = "pending_auth_sessions"
  38. // PendingAuthSessionColumn is the table column denoting the pending_auth_session relation/edge.
  39. PendingAuthSessionColumn = "pending_auth_session_id"
  40. // IdentityTable is the table that holds the identity relation/edge.
  41. IdentityTable = "identity_adoption_decisions"
  42. // IdentityInverseTable is the table name for the AuthIdentity entity.
  43. // It exists in this package in order to avoid circular dependency with the "authidentity" package.
  44. IdentityInverseTable = "auth_identities"
  45. // IdentityColumn is the table column denoting the identity relation/edge.
  46. IdentityColumn = "identity_id"
  47. )
  48. // Columns holds all SQL columns for identityadoptiondecision fields.
  49. var Columns = []string{
  50. FieldID,
  51. FieldCreatedAt,
  52. FieldUpdatedAt,
  53. FieldPendingAuthSessionID,
  54. FieldIdentityID,
  55. FieldAdoptDisplayName,
  56. FieldAdoptAvatar,
  57. FieldDecidedAt,
  58. }
  59. // ValidColumn reports if the column name is valid (part of the table columns).
  60. func ValidColumn(column string) bool {
  61. for i := range Columns {
  62. if column == Columns[i] {
  63. return true
  64. }
  65. }
  66. return false
  67. }
  68. var (
  69. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  70. DefaultCreatedAt func() time.Time
  71. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  72. DefaultUpdatedAt func() time.Time
  73. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  74. UpdateDefaultUpdatedAt func() time.Time
  75. // DefaultAdoptDisplayName holds the default value on creation for the "adopt_display_name" field.
  76. DefaultAdoptDisplayName bool
  77. // DefaultAdoptAvatar holds the default value on creation for the "adopt_avatar" field.
  78. DefaultAdoptAvatar bool
  79. // DefaultDecidedAt holds the default value on creation for the "decided_at" field.
  80. DefaultDecidedAt func() time.Time
  81. )
  82. // OrderOption defines the ordering options for the IdentityAdoptionDecision queries.
  83. type OrderOption func(*sql.Selector)
  84. // ByID orders the results by the id field.
  85. func ByID(opts ...sql.OrderTermOption) OrderOption {
  86. return sql.OrderByField(FieldID, opts...).ToFunc()
  87. }
  88. // ByCreatedAt orders the results by the created_at field.
  89. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  90. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  91. }
  92. // ByUpdatedAt orders the results by the updated_at field.
  93. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  94. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  95. }
  96. // ByPendingAuthSessionID orders the results by the pending_auth_session_id field.
  97. func ByPendingAuthSessionID(opts ...sql.OrderTermOption) OrderOption {
  98. return sql.OrderByField(FieldPendingAuthSessionID, opts...).ToFunc()
  99. }
  100. // ByIdentityID orders the results by the identity_id field.
  101. func ByIdentityID(opts ...sql.OrderTermOption) OrderOption {
  102. return sql.OrderByField(FieldIdentityID, opts...).ToFunc()
  103. }
  104. // ByAdoptDisplayName orders the results by the adopt_display_name field.
  105. func ByAdoptDisplayName(opts ...sql.OrderTermOption) OrderOption {
  106. return sql.OrderByField(FieldAdoptDisplayName, opts...).ToFunc()
  107. }
  108. // ByAdoptAvatar orders the results by the adopt_avatar field.
  109. func ByAdoptAvatar(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldAdoptAvatar, opts...).ToFunc()
  111. }
  112. // ByDecidedAt orders the results by the decided_at field.
  113. func ByDecidedAt(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldDecidedAt, opts...).ToFunc()
  115. }
  116. // ByPendingAuthSessionField orders the results by pending_auth_session field.
  117. func ByPendingAuthSessionField(field string, opts ...sql.OrderTermOption) OrderOption {
  118. return func(s *sql.Selector) {
  119. sqlgraph.OrderByNeighborTerms(s, newPendingAuthSessionStep(), sql.OrderByField(field, opts...))
  120. }
  121. }
  122. // ByIdentityField orders the results by identity field.
  123. func ByIdentityField(field string, opts ...sql.OrderTermOption) OrderOption {
  124. return func(s *sql.Selector) {
  125. sqlgraph.OrderByNeighborTerms(s, newIdentityStep(), sql.OrderByField(field, opts...))
  126. }
  127. }
  128. func newPendingAuthSessionStep() *sqlgraph.Step {
  129. return sqlgraph.NewStep(
  130. sqlgraph.From(Table, FieldID),
  131. sqlgraph.To(PendingAuthSessionInverseTable, FieldID),
  132. sqlgraph.Edge(sqlgraph.O2O, true, PendingAuthSessionTable, PendingAuthSessionColumn),
  133. )
  134. }
  135. func newIdentityStep() *sqlgraph.Step {
  136. return sqlgraph.NewStep(
  137. sqlgraph.From(Table, FieldID),
  138. sqlgraph.To(IdentityInverseTable, FieldID),
  139. sqlgraph.Edge(sqlgraph.M2O, true, IdentityTable, IdentityColumn),
  140. )
  141. }