147 lines
5.3 KiB
Go
147 lines
5.3 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package texture
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the texture type in the database.
|
|
Label = "texture"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldTextureHash holds the string denoting the texture_hash field in the database.
|
|
FieldTextureHash = "texture_hash"
|
|
// EdgeCreatedUser holds the string denoting the created_user edge name in mutations.
|
|
EdgeCreatedUser = "created_user"
|
|
// EdgeUserProfile holds the string denoting the user_profile edge name in mutations.
|
|
EdgeUserProfile = "user_profile"
|
|
// EdgeUsertexture holds the string denoting the usertexture edge name in mutations.
|
|
EdgeUsertexture = "usertexture"
|
|
// Table holds the table name of the texture in the database.
|
|
Table = "textures"
|
|
// CreatedUserTable is the table that holds the created_user relation/edge.
|
|
CreatedUserTable = "textures"
|
|
// CreatedUserInverseTable is the table name for the User entity.
|
|
// It exists in this package in order to avoid circular dependency with the "user" package.
|
|
CreatedUserInverseTable = "users"
|
|
// CreatedUserColumn is the table column denoting the created_user relation/edge.
|
|
CreatedUserColumn = "texture_created_user"
|
|
// UserProfileTable is the table that holds the user_profile relation/edge. The primary key declared below.
|
|
UserProfileTable = "user_textures"
|
|
// UserProfileInverseTable is the table name for the UserProfile entity.
|
|
// It exists in this package in order to avoid circular dependency with the "userprofile" package.
|
|
UserProfileInverseTable = "user_profiles"
|
|
// UsertextureTable is the table that holds the usertexture relation/edge.
|
|
UsertextureTable = "user_textures"
|
|
// UsertextureInverseTable is the table name for the UserTexture entity.
|
|
// It exists in this package in order to avoid circular dependency with the "usertexture" package.
|
|
UsertextureInverseTable = "user_textures"
|
|
// UsertextureColumn is the table column denoting the usertexture relation/edge.
|
|
UsertextureColumn = "texture_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for texture fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldTextureHash,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "textures"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"texture_created_user",
|
|
}
|
|
|
|
var (
|
|
// UserProfilePrimaryKey and UserProfileColumn2 are the table columns denoting the
|
|
// primary key for the user_profile relation (M2M).
|
|
UserProfilePrimaryKey = []string{"texture_id", "user_profile_id"}
|
|
)
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
for i := range ForeignKeys {
|
|
if column == ForeignKeys[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// OrderOption defines the ordering options for the Texture queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTextureHash orders the results by the texture_hash field.
|
|
func ByTextureHash(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTextureHash, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedUserField orders the results by created_user field.
|
|
func ByCreatedUserField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newCreatedUserStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
|
|
// ByUserProfileCount orders the results by user_profile count.
|
|
func ByUserProfileCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newUserProfileStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByUserProfile orders the results by user_profile terms.
|
|
func ByUserProfile(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newUserProfileStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByUsertextureCount orders the results by usertexture count.
|
|
func ByUsertextureCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newUsertextureStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByUsertexture orders the results by usertexture terms.
|
|
func ByUsertexture(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newUsertextureStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
func newCreatedUserStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(CreatedUserInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, CreatedUserTable, CreatedUserColumn),
|
|
)
|
|
}
|
|
func newUserProfileStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(UserProfileInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2M, false, UserProfileTable, UserProfilePrimaryKey...),
|
|
)
|
|
}
|
|
func newUsertextureStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(UsertextureInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, UsertextureTable, UsertextureColumn),
|
|
)
|
|
}
|