// Code generated by ent, DO NOT EDIT. package domain import ( "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) const ( // Label holds the string label denoting the domain type in the database. Label = "domain" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldCreated holds the string denoting the created field in the database. FieldCreated = "created" // FieldModified holds the string denoting the modified field in the database. FieldModified = "modified" // FieldDomain holds the string denoting the domain field in the database. FieldDomain = "domain" // FieldDescription holds the string denoting the description field in the database. FieldDescription = "description" // FieldMaxAliases holds the string denoting the max_aliases field in the database. FieldMaxAliases = "max_aliases" // FieldMaxMailboxes holds the string denoting the max_mailboxes field in the database. FieldMaxMailboxes = "max_mailboxes" // FieldMaxQuota holds the string denoting the max_quota field in the database. FieldMaxQuota = "max_quota" // FieldQuota holds the string denoting the quota field in the database. FieldQuota = "quota" // FieldTransport holds the string denoting the transport field in the database. FieldTransport = "transport" // FieldBackupMx holds the string denoting the backup_mx field in the database. FieldBackupMx = "backup_mx" // FieldActive holds the string denoting the active field in the database. FieldActive = "active" // EdgeMailboxes holds the string denoting the mailboxes edge name in mutations. EdgeMailboxes = "mailboxes" // EdgeAliases holds the string denoting the aliases edge name in mutations. EdgeAliases = "aliases" // EdgeLogs holds the string denoting the logs edge name in mutations. EdgeLogs = "logs" // EdgeAccounts holds the string denoting the accounts edge name in mutations. EdgeAccounts = "accounts" // Table holds the table name of the domain in the database. Table = "domains" // MailboxesTable is the table that holds the mailboxes relation/edge. MailboxesTable = "mailboxes" // MailboxesInverseTable is the table name for the Mailbox entity. // It exists in this package in order to avoid circular dependency with the "mailbox" package. MailboxesInverseTable = "mailboxes" // MailboxesColumn is the table column denoting the mailboxes relation/edge. MailboxesColumn = "domain_id" // AliasesTable is the table that holds the aliases relation/edge. AliasesTable = "alias" // AliasesInverseTable is the table name for the Alias entity. // It exists in this package in order to avoid circular dependency with the "alias" package. AliasesInverseTable = "alias" // AliasesColumn is the table column denoting the aliases relation/edge. AliasesColumn = "domain_id" // LogsTable is the table that holds the logs relation/edge. LogsTable = "logentries" // LogsInverseTable is the table name for the Logentry entity. // It exists in this package in order to avoid circular dependency with the "logentry" package. LogsInverseTable = "logentries" // LogsColumn is the table column denoting the logs relation/edge. LogsColumn = "domain_id" // AccountsTable is the table that holds the accounts relation/edge. The primary key declared below. AccountsTable = "account_domains" // AccountsInverseTable is the table name for the Account entity. // It exists in this package in order to avoid circular dependency with the "account" package. AccountsInverseTable = "accounts" ) // Columns holds all SQL columns for domain fields. var Columns = []string{ FieldID, FieldCreated, FieldModified, FieldDomain, FieldDescription, FieldMaxAliases, FieldMaxMailboxes, FieldMaxQuota, FieldQuota, FieldTransport, FieldBackupMx, FieldActive, } var ( // AccountsPrimaryKey and AccountsColumn2 are the table columns denoting the // primary key for the accounts relation (M2M). AccountsPrimaryKey = []string{"account_id", "domain_id"} ) // 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 ( // DefaultCreated holds the default value on creation for the "created" field. DefaultCreated func() time.Time // DefaultModified holds the default value on creation for the "modified" field. DefaultModified func() time.Time // UpdateDefaultModified holds the default value on update for the "modified" field. UpdateDefaultModified func() time.Time ) // OrderOption defines the ordering options for the Domain 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() } // ByCreated orders the results by the created field. func ByCreated(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreated, opts...).ToFunc() } // ByModified orders the results by the modified field. func ByModified(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldModified, opts...).ToFunc() } // ByDomain orders the results by the domain field. func ByDomain(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDomain, opts...).ToFunc() } // ByDescription orders the results by the description field. func ByDescription(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDescription, opts...).ToFunc() } // ByMaxAliases orders the results by the max_aliases field. func ByMaxAliases(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMaxAliases, opts...).ToFunc() } // ByMaxMailboxes orders the results by the max_mailboxes field. func ByMaxMailboxes(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMaxMailboxes, opts...).ToFunc() } // ByMaxQuota orders the results by the max_quota field. func ByMaxQuota(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMaxQuota, opts...).ToFunc() } // ByQuota orders the results by the quota field. func ByQuota(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldQuota, opts...).ToFunc() } // ByTransport orders the results by the transport field. func ByTransport(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTransport, opts...).ToFunc() } // ByBackupMx orders the results by the backup_mx field. func ByBackupMx(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBackupMx, opts...).ToFunc() } // ByActive orders the results by the active field. func ByActive(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldActive, opts...).ToFunc() } // ByMailboxesCount orders the results by mailboxes count. func ByMailboxesCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newMailboxesStep(), opts...) } } // ByMailboxes orders the results by mailboxes terms. func ByMailboxes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newMailboxesStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByAliasesCount orders the results by aliases count. func ByAliasesCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newAliasesStep(), opts...) } } // ByAliases orders the results by aliases terms. func ByAliases(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newAliasesStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByLogsCount orders the results by logs count. func ByLogsCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newLogsStep(), opts...) } } // ByLogs orders the results by logs terms. func ByLogs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newLogsStep(), append([]sql.OrderTerm{term}, terms...)...) } } // ByAccountsCount orders the results by accounts count. func ByAccountsCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newAccountsStep(), opts...) } } // ByAccounts orders the results by accounts terms. func ByAccounts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newAccountsStep(), append([]sql.OrderTerm{term}, terms...)...) } } func newMailboxesStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(MailboxesInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, false, MailboxesTable, MailboxesColumn), ) } func newAliasesStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(AliasesInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, false, AliasesTable, AliasesColumn), ) } func newLogsStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(LogsInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, false, LogsTable, LogsColumn), ) } func newAccountsStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(AccountsInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2M, true, AccountsTable, AccountsPrimaryKey...), ) }