// Code generated by ent, DO NOT EDIT. package alert import ( "time" "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the alert type in the database. Label = "alert" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldRuleId holds the string denoting the ruleid field in the database. FieldRuleId = "rule_id" // FieldType holds the string denoting the type field in the database. FieldType = "type" // FieldTitle holds the string denoting the title field in the database. FieldTitle = "title" // FieldContent holds the string denoting the content field in the database. FieldContent = "content" // FieldRefType holds the string denoting the reftype field in the database. FieldRefType = "ref_type" // FieldRefId holds the string denoting the refid field in the database. FieldRefId = "ref_id" // FieldStatus holds the string denoting the status field in the database. FieldStatus = "status" // FieldReceiver holds the string denoting the receiver field in the database. FieldReceiver = "receiver" // FieldCreatedAt holds the string denoting the createdat field in the database. FieldCreatedAt = "created_at" // Table holds the table name of the alert in the database. Table = "alert" ) // Columns holds all SQL columns for alert fields. var Columns = []string{ FieldID, FieldRuleId, FieldType, FieldTitle, FieldContent, FieldRefType, FieldRefId, FieldStatus, FieldReceiver, FieldCreatedAt, } // 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 ( // DefaultRuleId holds the default value on creation for the "ruleId" field. DefaultRuleId int // TypeValidator is a validator for the "type" field. It is called by the builders before save. TypeValidator func(string) error // TitleValidator is a validator for the "title" field. It is called by the builders before save. TitleValidator func(string) error // DefaultContent holds the default value on creation for the "content" field. DefaultContent string // ContentValidator is a validator for the "content" field. It is called by the builders before save. ContentValidator func(string) error // DefaultRefType holds the default value on creation for the "refType" field. DefaultRefType string // RefTypeValidator is a validator for the "refType" field. It is called by the builders before save. RefTypeValidator func(string) error // DefaultRefId holds the default value on creation for the "refId" field. DefaultRefId string // RefIdValidator is a validator for the "refId" field. It is called by the builders before save. RefIdValidator func(string) error // DefaultStatus holds the default value on creation for the "status" field. DefaultStatus string // StatusValidator is a validator for the "status" field. It is called by the builders before save. StatusValidator func(string) error // DefaultReceiver holds the default value on creation for the "receiver" field. DefaultReceiver string // ReceiverValidator is a validator for the "receiver" field. It is called by the builders before save. ReceiverValidator func(string) error // DefaultCreatedAt holds the default value on creation for the "createdAt" field. DefaultCreatedAt func() time.Time // IDValidator is a validator for the "id" field. It is called by the builders before save. IDValidator func(int) error ) // OrderOption defines the ordering options for the Alert 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() } // ByRuleId orders the results by the ruleId field. func ByRuleId(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRuleId, opts...).ToFunc() } // ByType orders the results by the type field. func ByType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldType, opts...).ToFunc() } // ByTitle orders the results by the title field. func ByTitle(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTitle, opts...).ToFunc() } // ByContent orders the results by the content field. func ByContent(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldContent, opts...).ToFunc() } // ByRefType orders the results by the refType field. func ByRefType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefType, opts...).ToFunc() } // ByRefId orders the results by the refId field. func ByRefId(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefId, opts...).ToFunc() } // ByStatus orders the results by the status field. func ByStatus(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStatus, opts...).ToFunc() } // ByReceiver orders the results by the receiver field. func ByReceiver(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldReceiver, opts...).ToFunc() } // ByCreatedAt orders the results by the createdAt field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() }