148 lines
5.0 KiB
Go
148 lines
5.0 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package scaauthpermissionrule
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the scaauthpermissionrule type in the database.
|
|
Label = "sca_auth_permission_rule"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldPtype holds the string denoting the ptype field in the database.
|
|
FieldPtype = "ptype"
|
|
// FieldV0 holds the string denoting the v0 field in the database.
|
|
FieldV0 = "v0"
|
|
// FieldV1 holds the string denoting the v1 field in the database.
|
|
FieldV1 = "v1"
|
|
// FieldV2 holds the string denoting the v2 field in the database.
|
|
FieldV2 = "v2"
|
|
// FieldV3 holds the string denoting the v3 field in the database.
|
|
FieldV3 = "v3"
|
|
// FieldV4 holds the string denoting the v4 field in the database.
|
|
FieldV4 = "v4"
|
|
// FieldV5 holds the string denoting the v5 field in the database.
|
|
FieldV5 = "v5"
|
|
// EdgeScaAuthRole holds the string denoting the sca_auth_role edge name in mutations.
|
|
EdgeScaAuthRole = "sca_auth_role"
|
|
// Table holds the table name of the scaauthpermissionrule in the database.
|
|
Table = "sca_auth_permission_rules"
|
|
// ScaAuthRoleTable is the table that holds the sca_auth_role relation/edge.
|
|
ScaAuthRoleTable = "sca_auth_permission_rules"
|
|
// ScaAuthRoleInverseTable is the table name for the ScaAuthRole entity.
|
|
// It exists in this package in order to avoid circular dependency with the "scaauthrole" package.
|
|
ScaAuthRoleInverseTable = "sca_auth_roles"
|
|
// ScaAuthRoleColumn is the table column denoting the sca_auth_role relation/edge.
|
|
ScaAuthRoleColumn = "sca_auth_role_sca_auth_permission_rule"
|
|
)
|
|
|
|
// Columns holds all SQL columns for scaauthpermissionrule fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldPtype,
|
|
FieldV0,
|
|
FieldV1,
|
|
FieldV2,
|
|
FieldV3,
|
|
FieldV4,
|
|
FieldV5,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "sca_auth_permission_rules"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"sca_auth_role_sca_auth_permission_rule",
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
var (
|
|
// PtypeValidator is a validator for the "ptype" field. It is called by the builders before save.
|
|
PtypeValidator func(string) error
|
|
// V0Validator is a validator for the "v0" field. It is called by the builders before save.
|
|
V0Validator func(string) error
|
|
// V1Validator is a validator for the "v1" field. It is called by the builders before save.
|
|
V1Validator func(string) error
|
|
// V2Validator is a validator for the "v2" field. It is called by the builders before save.
|
|
V2Validator func(string) error
|
|
// V3Validator is a validator for the "v3" field. It is called by the builders before save.
|
|
V3Validator func(string) error
|
|
// V4Validator is a validator for the "v4" field. It is called by the builders before save.
|
|
V4Validator func(string) error
|
|
// V5Validator is a validator for the "v5" field. It is called by the builders before save.
|
|
V5Validator func(string) error
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the ScaAuthPermissionRule 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()
|
|
}
|
|
|
|
// ByPtype orders the results by the ptype field.
|
|
func ByPtype(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPtype, opts...).ToFunc()
|
|
}
|
|
|
|
// ByV0 orders the results by the v0 field.
|
|
func ByV0(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldV0, opts...).ToFunc()
|
|
}
|
|
|
|
// ByV1 orders the results by the v1 field.
|
|
func ByV1(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldV1, opts...).ToFunc()
|
|
}
|
|
|
|
// ByV2 orders the results by the v2 field.
|
|
func ByV2(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldV2, opts...).ToFunc()
|
|
}
|
|
|
|
// ByV3 orders the results by the v3 field.
|
|
func ByV3(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldV3, opts...).ToFunc()
|
|
}
|
|
|
|
// ByV4 orders the results by the v4 field.
|
|
func ByV4(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldV4, opts...).ToFunc()
|
|
}
|
|
|
|
// ByV5 orders the results by the v5 field.
|
|
func ByV5(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldV5, opts...).ToFunc()
|
|
}
|
|
|
|
// ByScaAuthRoleField orders the results by sca_auth_role field.
|
|
func ByScaAuthRoleField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newScaAuthRoleStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newScaAuthRoleStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ScaAuthRoleInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, ScaAuthRoleTable, ScaAuthRoleColumn),
|
|
)
|
|
}
|