group.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Code generated by entc, DO NOT EDIT.
  2. package group
  3. const (
  4. // Label holds the string label denoting the group type in the database.
  5. Label = "group"
  6. // FieldID holds the string denoting the id field in the database.
  7. FieldID = "id"
  8. // FieldName holds the string denoting the name field in the database.
  9. FieldName = "name"
  10. // EdgeUsers holds the string denoting the users edge name in mutations.
  11. EdgeUsers = "users"
  12. // Table holds the table name of the group in the database.
  13. Table = "groups"
  14. // UsersTable is the table that holds the users relation/edge. The primary key declared below.
  15. UsersTable = "group_users"
  16. // UsersInverseTable is the table name for the User entity.
  17. // It exists in this package in order to avoid circular dependency with the "user" package.
  18. UsersInverseTable = "users"
  19. )
  20. // Columns holds all SQL columns for group fields.
  21. var Columns = []string{
  22. FieldID,
  23. FieldName,
  24. }
  25. var (
  26. // UsersPrimaryKey and UsersColumn2 are the table columns denoting the
  27. // primary key for the users relation (M2M).
  28. UsersPrimaryKey = []string{"group_id", "user_id"}
  29. )
  30. // ValidColumn reports if the column name is valid (part of the table columns).
  31. func ValidColumn(column string) bool {
  32. for i := range Columns {
  33. if column == Columns[i] {
  34. return true
  35. }
  36. }
  37. return false
  38. }
  39. var (
  40. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  41. NameValidator func(string) error
  42. )