113 lines
4.0 KiB
Go
113 lines
4.0 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package userpreferences
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the userpreferences type in the database.
|
|
Label = "user_preferences"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldNotificationOrder holds the string denoting the notification_order field in the database.
|
|
FieldNotificationOrder = "notification_order"
|
|
// FieldNotificationCommunity holds the string denoting the notification_community field in the database.
|
|
FieldNotificationCommunity = "notification_community"
|
|
// FieldNotificationSystem holds the string denoting the notification_system field in the database.
|
|
FieldNotificationSystem = "notification_system"
|
|
// FieldTheme holds the string denoting the theme field in the database.
|
|
FieldTheme = "theme"
|
|
// FieldLanguage holds the string denoting the language field in the database.
|
|
FieldLanguage = "language"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// Table holds the table name of the userpreferences in the database.
|
|
Table = "user_preferences"
|
|
)
|
|
|
|
// Columns holds all SQL columns for userpreferences fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldUserID,
|
|
FieldNotificationOrder,
|
|
FieldNotificationCommunity,
|
|
FieldNotificationSystem,
|
|
FieldTheme,
|
|
FieldLanguage,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// DefaultNotificationOrder holds the default value on creation for the "notification_order" field.
|
|
DefaultNotificationOrder bool
|
|
// DefaultNotificationCommunity holds the default value on creation for the "notification_community" field.
|
|
DefaultNotificationCommunity bool
|
|
// DefaultNotificationSystem holds the default value on creation for the "notification_system" field.
|
|
DefaultNotificationSystem bool
|
|
// DefaultTheme holds the default value on creation for the "theme" field.
|
|
DefaultTheme string
|
|
// DefaultLanguage holds the default value on creation for the "language" field.
|
|
DefaultLanguage string
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the UserPreferences 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()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByNotificationOrder orders the results by the notification_order field.
|
|
func ByNotificationOrder(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldNotificationOrder, opts...).ToFunc()
|
|
}
|
|
|
|
// ByNotificationCommunity orders the results by the notification_community field.
|
|
func ByNotificationCommunity(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldNotificationCommunity, opts...).ToFunc()
|
|
}
|
|
|
|
// ByNotificationSystem orders the results by the notification_system field.
|
|
func ByNotificationSystem(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldNotificationSystem, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTheme orders the results by the theme field.
|
|
func ByTheme(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTheme, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLanguage orders the results by the language field.
|
|
func ByLanguage(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLanguage, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|