decision.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Code generated by entc, DO NOT EDIT.
  2. package decision
  3. import (
  4. "time"
  5. )
  6. const (
  7. // Label holds the string label denoting the decision type in the database.
  8. Label = "decision"
  9. // FieldID holds the string denoting the id field in the database.
  10. FieldID = "id"
  11. // FieldCreatedAt holds the string denoting the created_at field in the database.
  12. FieldCreatedAt = "created_at"
  13. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  14. FieldUpdatedAt = "updated_at"
  15. // FieldUntil holds the string denoting the until field in the database.
  16. FieldUntil = "until"
  17. // FieldScenario holds the string denoting the scenario field in the database.
  18. FieldScenario = "scenario"
  19. // FieldType holds the string denoting the type field in the database.
  20. FieldType = "type"
  21. // FieldStartIP holds the string denoting the start_ip field in the database.
  22. FieldStartIP = "start_ip"
  23. // FieldEndIP holds the string denoting the end_ip field in the database.
  24. FieldEndIP = "end_ip"
  25. // FieldStartSuffix holds the string denoting the start_suffix field in the database.
  26. FieldStartSuffix = "start_suffix"
  27. // FieldEndSuffix holds the string denoting the end_suffix field in the database.
  28. FieldEndSuffix = "end_suffix"
  29. // FieldIPSize holds the string denoting the ip_size field in the database.
  30. FieldIPSize = "ip_size"
  31. // FieldScope holds the string denoting the scope field in the database.
  32. FieldScope = "scope"
  33. // FieldValue holds the string denoting the value field in the database.
  34. FieldValue = "value"
  35. // FieldOrigin holds the string denoting the origin field in the database.
  36. FieldOrigin = "origin"
  37. // FieldSimulated holds the string denoting the simulated field in the database.
  38. FieldSimulated = "simulated"
  39. // EdgeOwner holds the string denoting the owner edge name in mutations.
  40. EdgeOwner = "owner"
  41. // Table holds the table name of the decision in the database.
  42. Table = "decisions"
  43. // OwnerTable is the table that holds the owner relation/edge.
  44. OwnerTable = "decisions"
  45. // OwnerInverseTable is the table name for the Alert entity.
  46. // It exists in this package in order to avoid circular dependency with the "alert" package.
  47. OwnerInverseTable = "alerts"
  48. // OwnerColumn is the table column denoting the owner relation/edge.
  49. OwnerColumn = "alert_decisions"
  50. )
  51. // Columns holds all SQL columns for decision fields.
  52. var Columns = []string{
  53. FieldID,
  54. FieldCreatedAt,
  55. FieldUpdatedAt,
  56. FieldUntil,
  57. FieldScenario,
  58. FieldType,
  59. FieldStartIP,
  60. FieldEndIP,
  61. FieldStartSuffix,
  62. FieldEndSuffix,
  63. FieldIPSize,
  64. FieldScope,
  65. FieldValue,
  66. FieldOrigin,
  67. FieldSimulated,
  68. }
  69. // ForeignKeys holds the SQL foreign-keys that are owned by the "decisions"
  70. // table and are not defined as standalone fields in the schema.
  71. var ForeignKeys = []string{
  72. "alert_decisions",
  73. }
  74. // ValidColumn reports if the column name is valid (part of the table columns).
  75. func ValidColumn(column string) bool {
  76. for i := range Columns {
  77. if column == Columns[i] {
  78. return true
  79. }
  80. }
  81. for i := range ForeignKeys {
  82. if column == ForeignKeys[i] {
  83. return true
  84. }
  85. }
  86. return false
  87. }
  88. var (
  89. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  90. DefaultCreatedAt func() time.Time
  91. // UpdateDefaultCreatedAt holds the default value on update for the "created_at" field.
  92. UpdateDefaultCreatedAt func() time.Time
  93. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  94. DefaultUpdatedAt func() time.Time
  95. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  96. UpdateDefaultUpdatedAt func() time.Time
  97. // DefaultSimulated holds the default value on creation for the "simulated" field.
  98. DefaultSimulated bool
  99. )