// Code generated by ent, DO NOT EDIT. package app import ( "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) const ( // Label holds the string label denoting the app type in the database. Label = "app" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" // FieldStatus holds the string denoting the status field in the database. FieldStatus = "status" // FieldTenantID holds the string denoting the tenant_id field in the database. FieldTenantID = "tenant_id" // FieldDeletedAt holds the string denoting the deleted_at field in the database. FieldDeletedAt = "deleted_at" // FieldAppKey holds the string denoting the app_key field in the database. FieldAppKey = "app_key" // FieldAppName holds the string denoting the app_name field in the database. FieldAppName = "app_name" // FieldOrderNotifyURL holds the string denoting the order_notify_url field in the database. FieldOrderNotifyURL = "order_notify_url" // FieldRefundNotifyURL holds the string denoting the refund_notify_url field in the database. FieldRefundNotifyURL = "refund_notify_url" // EdgeChannel holds the string denoting the channel edge name in mutations. EdgeChannel = "channel" // EdgeNotifyTask holds the string denoting the notify_task edge name in mutations. EdgeNotifyTask = "notify_task" // Table holds the table name of the app in the database. Table = "pay_app" // ChannelTable is the table that holds the channel relation/edge. ChannelTable = "pay_channel" // ChannelInverseTable is the table name for the PayChannel entity. // It exists in this package in order to avoid circular dependency with the "paychannel" package. ChannelInverseTable = "pay_channel" // ChannelColumn is the table column denoting the channel relation/edge. ChannelColumn = "app_id" // NotifyTaskTable is the table that holds the notify_task relation/edge. NotifyTaskTable = "pay_notify_task" // NotifyTaskInverseTable is the table name for the PayNotifyTask entity. // It exists in this package in order to avoid circular dependency with the "paynotifytask" package. NotifyTaskInverseTable = "pay_notify_task" // NotifyTaskColumn is the table column denoting the notify_task relation/edge. NotifyTaskColumn = "app_id" ) // Columns holds all SQL columns for app fields. var Columns = []string{ FieldID, FieldCreatedAt, FieldUpdatedAt, FieldStatus, FieldTenantID, FieldDeletedAt, FieldAppKey, FieldAppName, FieldOrderNotifyURL, FieldRefundNotifyURL, } // 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 ( // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. DefaultUpdatedAt func() time.Time // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. UpdateDefaultUpdatedAt func() time.Time // DefaultStatus holds the default value on creation for the "status" field. DefaultStatus uint8 // DefaultTenantID holds the default value on creation for the "tenant_id" field. DefaultTenantID uint64 ) // OrderOption defines the ordering options for the App 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() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() } // ByUpdatedAt orders the results by the updated_at field. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() } // ByStatus orders the results by the status field. func ByStatus(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStatus, opts...).ToFunc() } // ByTenantID orders the results by the tenant_id field. func ByTenantID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTenantID, opts...).ToFunc() } // ByDeletedAt orders the results by the deleted_at field. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() } // ByAppKey orders the results by the app_key field. func ByAppKey(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAppKey, opts...).ToFunc() } // ByAppName orders the results by the app_name field. func ByAppName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAppName, opts...).ToFunc() } // ByOrderNotifyURL orders the results by the order_notify_url field. func ByOrderNotifyURL(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOrderNotifyURL, opts...).ToFunc() } // ByRefundNotifyURL orders the results by the refund_notify_url field. func ByRefundNotifyURL(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRefundNotifyURL, opts...).ToFunc() } // ByChannelCount orders the results by channel count. func ByChannelCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newChannelStep(), opts...) } } // ByChannel orders the results by channel terms. func ByChannel(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newChannelStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByNotifyTaskCount orders the results by notify_task count. func ByNotifyTaskCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newNotifyTaskStep(), opts...) } } // ByNotifyTask orders the results by notify_task terms. func ByNotifyTask(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newNotifyTaskStep(), append([]sql.OrderTerm{term}, terms...)...) } } func newChannelStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(ChannelInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, true, ChannelTable, ChannelColumn), ) } func newNotifyTaskStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(NotifyTaskInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, true, NotifyTaskTable, NotifyTaskColumn), ) }