Files
schisandra-album-cloud-micr…/common/ent/scaauthrole/scaauthrole.go
landaiqing 97ca3fc7b0 🎉 init
2024-11-12 17:00:16 +08:00

128 lines
4.8 KiB
Go

// Code generated by ent, DO NOT EDIT.
package scaauthrole
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the scaauthrole type in the database.
Label = "sca_auth_role"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldRoleName holds the string denoting the role_name field in the database.
FieldRoleName = "role_name"
// FieldRoleKey holds the string denoting the role_key field in the database.
FieldRoleKey = "role_key"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdateAt holds the string denoting the update_at field in the database.
FieldUpdateAt = "update_at"
// FieldDeleted holds the string denoting the deleted field in the database.
FieldDeleted = "deleted"
// EdgeScaAuthPermissionRule holds the string denoting the sca_auth_permission_rule edge name in mutations.
EdgeScaAuthPermissionRule = "sca_auth_permission_rule"
// Table holds the table name of the scaauthrole in the database.
Table = "sca_auth_roles"
// ScaAuthPermissionRuleTable is the table that holds the sca_auth_permission_rule relation/edge.
ScaAuthPermissionRuleTable = "sca_auth_permission_rules"
// ScaAuthPermissionRuleInverseTable is the table name for the ScaAuthPermissionRule entity.
// It exists in this package in order to avoid circular dependency with the "scaauthpermissionrule" package.
ScaAuthPermissionRuleInverseTable = "sca_auth_permission_rules"
// ScaAuthPermissionRuleColumn is the table column denoting the sca_auth_permission_rule relation/edge.
ScaAuthPermissionRuleColumn = "sca_auth_role_sca_auth_permission_rule"
)
// Columns holds all SQL columns for scaauthrole fields.
var Columns = []string{
FieldID,
FieldRoleName,
FieldRoleKey,
FieldCreatedAt,
FieldUpdateAt,
FieldDeleted,
}
// 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
}
}
return false
}
var (
// RoleNameValidator is a validator for the "role_name" field. It is called by the builders before save.
RoleNameValidator func(string) error
// RoleKeyValidator is a validator for the "role_key" field. It is called by the builders before save.
RoleKeyValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdateAt holds the default value on creation for the "update_at" field.
DefaultUpdateAt func() time.Time
// UpdateDefaultUpdateAt holds the default value on update for the "update_at" field.
UpdateDefaultUpdateAt func() time.Time
// DefaultDeleted holds the default value on creation for the "deleted" field.
DefaultDeleted int
)
// OrderOption defines the ordering options for the ScaAuthRole 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()
}
// ByRoleName orders the results by the role_name field.
func ByRoleName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRoleName, opts...).ToFunc()
}
// ByRoleKey orders the results by the role_key field.
func ByRoleKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRoleKey, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdateAt orders the results by the update_at field.
func ByUpdateAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdateAt, opts...).ToFunc()
}
// ByDeleted orders the results by the deleted field.
func ByDeleted(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeleted, opts...).ToFunc()
}
// ByScaAuthPermissionRuleCount orders the results by sca_auth_permission_rule count.
func ByScaAuthPermissionRuleCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newScaAuthPermissionRuleStep(), opts...)
}
}
// ByScaAuthPermissionRule orders the results by sca_auth_permission_rule terms.
func ByScaAuthPermissionRule(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newScaAuthPermissionRuleStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newScaAuthPermissionRuleStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ScaAuthPermissionRuleInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ScaAuthPermissionRuleTable, ScaAuthPermissionRuleColumn),
)
}