refactor(数据库): 迁移持久层到 Ent 并清理 GORM
将仓储层/基础设施改为 Ent + 原生 SQL 执行路径,并移除 AutoMigrate 与 GORM 依赖。 重构内容包括: - 仓储层改用 Ent/SQL(含 usage_log/account 等复杂查询),统一错误映射 - 基础设施与 setup 初始化切换为 Ent + SQL migrations - 集成测试与 fixtures 迁移到 Ent 事务模型 - 清理遗留 GORM 模型/依赖,补充迁移与文档说明 - 增加根目录 Makefile 便于前后端编译 测试: - go test -tags unit ./... - go test -tags integration ./...
This commit is contained in:
260
backend/ent/usersubscription/usersubscription.go
Normal file
260
backend/ent/usersubscription/usersubscription.go
Normal file
@@ -0,0 +1,260 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package usersubscription
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the usersubscription type in the database.
|
||||
Label = "user_subscription"
|
||||
// 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"
|
||||
// FieldUserID holds the string denoting the user_id field in the database.
|
||||
FieldUserID = "user_id"
|
||||
// FieldGroupID holds the string denoting the group_id field in the database.
|
||||
FieldGroupID = "group_id"
|
||||
// FieldStartsAt holds the string denoting the starts_at field in the database.
|
||||
FieldStartsAt = "starts_at"
|
||||
// FieldExpiresAt holds the string denoting the expires_at field in the database.
|
||||
FieldExpiresAt = "expires_at"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldDailyWindowStart holds the string denoting the daily_window_start field in the database.
|
||||
FieldDailyWindowStart = "daily_window_start"
|
||||
// FieldWeeklyWindowStart holds the string denoting the weekly_window_start field in the database.
|
||||
FieldWeeklyWindowStart = "weekly_window_start"
|
||||
// FieldMonthlyWindowStart holds the string denoting the monthly_window_start field in the database.
|
||||
FieldMonthlyWindowStart = "monthly_window_start"
|
||||
// FieldDailyUsageUsd holds the string denoting the daily_usage_usd field in the database.
|
||||
FieldDailyUsageUsd = "daily_usage_usd"
|
||||
// FieldWeeklyUsageUsd holds the string denoting the weekly_usage_usd field in the database.
|
||||
FieldWeeklyUsageUsd = "weekly_usage_usd"
|
||||
// FieldMonthlyUsageUsd holds the string denoting the monthly_usage_usd field in the database.
|
||||
FieldMonthlyUsageUsd = "monthly_usage_usd"
|
||||
// FieldAssignedBy holds the string denoting the assigned_by field in the database.
|
||||
FieldAssignedBy = "assigned_by"
|
||||
// FieldAssignedAt holds the string denoting the assigned_at field in the database.
|
||||
FieldAssignedAt = "assigned_at"
|
||||
// FieldNotes holds the string denoting the notes field in the database.
|
||||
FieldNotes = "notes"
|
||||
// EdgeUser holds the string denoting the user edge name in mutations.
|
||||
EdgeUser = "user"
|
||||
// EdgeGroup holds the string denoting the group edge name in mutations.
|
||||
EdgeGroup = "group"
|
||||
// EdgeAssignedByUser holds the string denoting the assigned_by_user edge name in mutations.
|
||||
EdgeAssignedByUser = "assigned_by_user"
|
||||
// Table holds the table name of the usersubscription in the database.
|
||||
Table = "user_subscriptions"
|
||||
// UserTable is the table that holds the user relation/edge.
|
||||
UserTable = "user_subscriptions"
|
||||
// UserInverseTable is the table name for the User entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "user" package.
|
||||
UserInverseTable = "users"
|
||||
// UserColumn is the table column denoting the user relation/edge.
|
||||
UserColumn = "user_id"
|
||||
// GroupTable is the table that holds the group relation/edge.
|
||||
GroupTable = "user_subscriptions"
|
||||
// GroupInverseTable is the table name for the Group entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "group" package.
|
||||
GroupInverseTable = "groups"
|
||||
// GroupColumn is the table column denoting the group relation/edge.
|
||||
GroupColumn = "group_id"
|
||||
// AssignedByUserTable is the table that holds the assigned_by_user relation/edge.
|
||||
AssignedByUserTable = "user_subscriptions"
|
||||
// AssignedByUserInverseTable is the table name for the User entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "user" package.
|
||||
AssignedByUserInverseTable = "users"
|
||||
// AssignedByUserColumn is the table column denoting the assigned_by_user relation/edge.
|
||||
AssignedByUserColumn = "assigned_by"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for usersubscription fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldUserID,
|
||||
FieldGroupID,
|
||||
FieldStartsAt,
|
||||
FieldExpiresAt,
|
||||
FieldStatus,
|
||||
FieldDailyWindowStart,
|
||||
FieldWeeklyWindowStart,
|
||||
FieldMonthlyWindowStart,
|
||||
FieldDailyUsageUsd,
|
||||
FieldWeeklyUsageUsd,
|
||||
FieldMonthlyUsageUsd,
|
||||
FieldAssignedBy,
|
||||
FieldAssignedAt,
|
||||
FieldNotes,
|
||||
}
|
||||
|
||||
// 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 string
|
||||
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
StatusValidator func(string) error
|
||||
// DefaultDailyUsageUsd holds the default value on creation for the "daily_usage_usd" field.
|
||||
DefaultDailyUsageUsd float64
|
||||
// DefaultWeeklyUsageUsd holds the default value on creation for the "weekly_usage_usd" field.
|
||||
DefaultWeeklyUsageUsd float64
|
||||
// DefaultMonthlyUsageUsd holds the default value on creation for the "monthly_usage_usd" field.
|
||||
DefaultMonthlyUsageUsd float64
|
||||
// DefaultAssignedAt holds the default value on creation for the "assigned_at" field.
|
||||
DefaultAssignedAt func() time.Time
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the UserSubscription 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()
|
||||
}
|
||||
|
||||
// ByUserID orders the results by the user_id field.
|
||||
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByGroupID orders the results by the group_id field.
|
||||
func ByGroupID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldGroupID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStartsAt orders the results by the starts_at field.
|
||||
func ByStartsAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStartsAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByExpiresAt orders the results by the expires_at field.
|
||||
func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldExpiresAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDailyWindowStart orders the results by the daily_window_start field.
|
||||
func ByDailyWindowStart(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDailyWindowStart, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByWeeklyWindowStart orders the results by the weekly_window_start field.
|
||||
func ByWeeklyWindowStart(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldWeeklyWindowStart, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByMonthlyWindowStart orders the results by the monthly_window_start field.
|
||||
func ByMonthlyWindowStart(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldMonthlyWindowStart, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDailyUsageUsd orders the results by the daily_usage_usd field.
|
||||
func ByDailyUsageUsd(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDailyUsageUsd, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByWeeklyUsageUsd orders the results by the weekly_usage_usd field.
|
||||
func ByWeeklyUsageUsd(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldWeeklyUsageUsd, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByMonthlyUsageUsd orders the results by the monthly_usage_usd field.
|
||||
func ByMonthlyUsageUsd(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldMonthlyUsageUsd, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAssignedBy orders the results by the assigned_by field.
|
||||
func ByAssignedBy(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAssignedBy, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAssignedAt orders the results by the assigned_at field.
|
||||
func ByAssignedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAssignedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNotes orders the results by the notes field.
|
||||
func ByNotes(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNotes, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUserField orders the results by user field.
|
||||
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
|
||||
// ByGroupField orders the results by group field.
|
||||
func ByGroupField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newGroupStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
|
||||
// ByAssignedByUserField orders the results by assigned_by_user field.
|
||||
func ByAssignedByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newAssignedByUserStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
func newUserStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(UserInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
|
||||
)
|
||||
}
|
||||
func newGroupStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(GroupInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, GroupTable, GroupColumn),
|
||||
)
|
||||
}
|
||||
func newAssignedByUserStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(AssignedByUserInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, AssignedByUserTable, AssignedByUserColumn),
|
||||
)
|
||||
}
|
||||
900
backend/ent/usersubscription/where.go
Normal file
900
backend/ent/usersubscription/where.go
Normal file
@@ -0,0 +1,900 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package usersubscription
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"github.com/Wei-Shaw/sub2api/ent/predicate"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
|
||||
func UserID(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ.
|
||||
func GroupID(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldGroupID, v))
|
||||
}
|
||||
|
||||
// StartsAt applies equality check predicate on the "starts_at" field. It's identical to StartsAtEQ.
|
||||
func StartsAt(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ.
|
||||
func ExpiresAt(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
|
||||
func Status(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// DailyWindowStart applies equality check predicate on the "daily_window_start" field. It's identical to DailyWindowStartEQ.
|
||||
func DailyWindowStart(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStart applies equality check predicate on the "weekly_window_start" field. It's identical to WeeklyWindowStartEQ.
|
||||
func WeeklyWindowStart(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStart applies equality check predicate on the "monthly_window_start" field. It's identical to MonthlyWindowStartEQ.
|
||||
func MonthlyWindowStart(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyUsageUsd applies equality check predicate on the "daily_usage_usd" field. It's identical to DailyUsageUsdEQ.
|
||||
func DailyUsageUsd(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsd applies equality check predicate on the "weekly_usage_usd" field. It's identical to WeeklyUsageUsdEQ.
|
||||
func WeeklyUsageUsd(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsd applies equality check predicate on the "monthly_usage_usd" field. It's identical to MonthlyUsageUsdEQ.
|
||||
func MonthlyUsageUsd(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// AssignedBy applies equality check predicate on the "assigned_by" field. It's identical to AssignedByEQ.
|
||||
func AssignedBy(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldAssignedBy, v))
|
||||
}
|
||||
|
||||
// AssignedAt applies equality check predicate on the "assigned_at" field. It's identical to AssignedAtEQ.
|
||||
func AssignedAt(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// Notes applies equality check predicate on the "notes" field. It's identical to NotesEQ.
|
||||
func Notes(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldNotes, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UserIDEQ applies the EQ predicate on the "user_id" field.
|
||||
func UserIDEQ(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDNEQ applies the NEQ predicate on the "user_id" field.
|
||||
func UserIDNEQ(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDIn applies the In predicate on the "user_id" field.
|
||||
func UserIDIn(vs ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldUserID, vs...))
|
||||
}
|
||||
|
||||
// UserIDNotIn applies the NotIn predicate on the "user_id" field.
|
||||
func UserIDNotIn(vs ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldUserID, vs...))
|
||||
}
|
||||
|
||||
// GroupIDEQ applies the EQ predicate on the "group_id" field.
|
||||
func GroupIDEQ(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldGroupID, v))
|
||||
}
|
||||
|
||||
// GroupIDNEQ applies the NEQ predicate on the "group_id" field.
|
||||
func GroupIDNEQ(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldGroupID, v))
|
||||
}
|
||||
|
||||
// GroupIDIn applies the In predicate on the "group_id" field.
|
||||
func GroupIDIn(vs ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldGroupID, vs...))
|
||||
}
|
||||
|
||||
// GroupIDNotIn applies the NotIn predicate on the "group_id" field.
|
||||
func GroupIDNotIn(vs ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldGroupID, vs...))
|
||||
}
|
||||
|
||||
// StartsAtEQ applies the EQ predicate on the "starts_at" field.
|
||||
func StartsAtEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// StartsAtNEQ applies the NEQ predicate on the "starts_at" field.
|
||||
func StartsAtNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// StartsAtIn applies the In predicate on the "starts_at" field.
|
||||
func StartsAtIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldStartsAt, vs...))
|
||||
}
|
||||
|
||||
// StartsAtNotIn applies the NotIn predicate on the "starts_at" field.
|
||||
func StartsAtNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldStartsAt, vs...))
|
||||
}
|
||||
|
||||
// StartsAtGT applies the GT predicate on the "starts_at" field.
|
||||
func StartsAtGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// StartsAtGTE applies the GTE predicate on the "starts_at" field.
|
||||
func StartsAtGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// StartsAtLT applies the LT predicate on the "starts_at" field.
|
||||
func StartsAtLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// StartsAtLTE applies the LTE predicate on the "starts_at" field.
|
||||
func StartsAtLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldStartsAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtEQ applies the EQ predicate on the "expires_at" field.
|
||||
func ExpiresAtEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field.
|
||||
func ExpiresAtNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtIn applies the In predicate on the "expires_at" field.
|
||||
func ExpiresAtIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldExpiresAt, vs...))
|
||||
}
|
||||
|
||||
// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field.
|
||||
func ExpiresAtNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldExpiresAt, vs...))
|
||||
}
|
||||
|
||||
// ExpiresAtGT applies the GT predicate on the "expires_at" field.
|
||||
func ExpiresAtGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtGTE applies the GTE predicate on the "expires_at" field.
|
||||
func ExpiresAtGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtLT applies the LT predicate on the "expires_at" field.
|
||||
func ExpiresAtLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// ExpiresAtLTE applies the LTE predicate on the "expires_at" field.
|
||||
func ExpiresAtLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldExpiresAt, v))
|
||||
}
|
||||
|
||||
// StatusEQ applies the EQ predicate on the "status" field.
|
||||
func StatusEQ(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusNEQ applies the NEQ predicate on the "status" field.
|
||||
func StatusNEQ(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusIn applies the In predicate on the "status" field.
|
||||
func StatusIn(vs ...string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldStatus, vs...))
|
||||
}
|
||||
|
||||
// StatusNotIn applies the NotIn predicate on the "status" field.
|
||||
func StatusNotIn(vs ...string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldStatus, vs...))
|
||||
}
|
||||
|
||||
// StatusGT applies the GT predicate on the "status" field.
|
||||
func StatusGT(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusGTE applies the GTE predicate on the "status" field.
|
||||
func StatusGTE(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusLT applies the LT predicate on the "status" field.
|
||||
func StatusLT(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusLTE applies the LTE predicate on the "status" field.
|
||||
func StatusLTE(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusContains applies the Contains predicate on the "status" field.
|
||||
func StatusContains(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldContains(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusHasPrefix applies the HasPrefix predicate on the "status" field.
|
||||
func StatusHasPrefix(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldHasPrefix(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusHasSuffix applies the HasSuffix predicate on the "status" field.
|
||||
func StatusHasSuffix(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldHasSuffix(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusEqualFold applies the EqualFold predicate on the "status" field.
|
||||
func StatusEqualFold(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEqualFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// StatusContainsFold applies the ContainsFold predicate on the "status" field.
|
||||
func StatusContainsFold(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldContainsFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartEQ applies the EQ predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartNEQ applies the NEQ predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartIn applies the In predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldDailyWindowStart, vs...))
|
||||
}
|
||||
|
||||
// DailyWindowStartNotIn applies the NotIn predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldDailyWindowStart, vs...))
|
||||
}
|
||||
|
||||
// DailyWindowStartGT applies the GT predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartGTE applies the GTE predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartLT applies the LT predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartLTE applies the LTE predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldDailyWindowStart, v))
|
||||
}
|
||||
|
||||
// DailyWindowStartIsNil applies the IsNil predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartIsNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIsNull(FieldDailyWindowStart))
|
||||
}
|
||||
|
||||
// DailyWindowStartNotNil applies the NotNil predicate on the "daily_window_start" field.
|
||||
func DailyWindowStartNotNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotNull(FieldDailyWindowStart))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartEQ applies the EQ predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartNEQ applies the NEQ predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartIn applies the In predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldWeeklyWindowStart, vs...))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartNotIn applies the NotIn predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldWeeklyWindowStart, vs...))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartGT applies the GT predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartGTE applies the GTE predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartLT applies the LT predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartLTE applies the LTE predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldWeeklyWindowStart, v))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartIsNil applies the IsNil predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartIsNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIsNull(FieldWeeklyWindowStart))
|
||||
}
|
||||
|
||||
// WeeklyWindowStartNotNil applies the NotNil predicate on the "weekly_window_start" field.
|
||||
func WeeklyWindowStartNotNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotNull(FieldWeeklyWindowStart))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartEQ applies the EQ predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartNEQ applies the NEQ predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartIn applies the In predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldMonthlyWindowStart, vs...))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartNotIn applies the NotIn predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldMonthlyWindowStart, vs...))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartGT applies the GT predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartGTE applies the GTE predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartLT applies the LT predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartLTE applies the LTE predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldMonthlyWindowStart, v))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartIsNil applies the IsNil predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartIsNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIsNull(FieldMonthlyWindowStart))
|
||||
}
|
||||
|
||||
// MonthlyWindowStartNotNil applies the NotNil predicate on the "monthly_window_start" field.
|
||||
func MonthlyWindowStartNotNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotNull(FieldMonthlyWindowStart))
|
||||
}
|
||||
|
||||
// DailyUsageUsdEQ applies the EQ predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdEQ(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// DailyUsageUsdNEQ applies the NEQ predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdNEQ(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// DailyUsageUsdIn applies the In predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdIn(vs ...float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldDailyUsageUsd, vs...))
|
||||
}
|
||||
|
||||
// DailyUsageUsdNotIn applies the NotIn predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdNotIn(vs ...float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldDailyUsageUsd, vs...))
|
||||
}
|
||||
|
||||
// DailyUsageUsdGT applies the GT predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdGT(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// DailyUsageUsdGTE applies the GTE predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdGTE(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// DailyUsageUsdLT applies the LT predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdLT(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// DailyUsageUsdLTE applies the LTE predicate on the "daily_usage_usd" field.
|
||||
func DailyUsageUsdLTE(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldDailyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdEQ applies the EQ predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdEQ(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdNEQ applies the NEQ predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdNEQ(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdIn applies the In predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdIn(vs ...float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldWeeklyUsageUsd, vs...))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdNotIn applies the NotIn predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdNotIn(vs ...float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldWeeklyUsageUsd, vs...))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdGT applies the GT predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdGT(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdGTE applies the GTE predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdGTE(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdLT applies the LT predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdLT(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// WeeklyUsageUsdLTE applies the LTE predicate on the "weekly_usage_usd" field.
|
||||
func WeeklyUsageUsdLTE(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldWeeklyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdEQ applies the EQ predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdEQ(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdNEQ applies the NEQ predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdNEQ(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdIn applies the In predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdIn(vs ...float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldMonthlyUsageUsd, vs...))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdNotIn applies the NotIn predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdNotIn(vs ...float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldMonthlyUsageUsd, vs...))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdGT applies the GT predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdGT(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdGTE applies the GTE predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdGTE(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdLT applies the LT predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdLT(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// MonthlyUsageUsdLTE applies the LTE predicate on the "monthly_usage_usd" field.
|
||||
func MonthlyUsageUsdLTE(v float64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldMonthlyUsageUsd, v))
|
||||
}
|
||||
|
||||
// AssignedByEQ applies the EQ predicate on the "assigned_by" field.
|
||||
func AssignedByEQ(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldAssignedBy, v))
|
||||
}
|
||||
|
||||
// AssignedByNEQ applies the NEQ predicate on the "assigned_by" field.
|
||||
func AssignedByNEQ(v int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldAssignedBy, v))
|
||||
}
|
||||
|
||||
// AssignedByIn applies the In predicate on the "assigned_by" field.
|
||||
func AssignedByIn(vs ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldAssignedBy, vs...))
|
||||
}
|
||||
|
||||
// AssignedByNotIn applies the NotIn predicate on the "assigned_by" field.
|
||||
func AssignedByNotIn(vs ...int64) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldAssignedBy, vs...))
|
||||
}
|
||||
|
||||
// AssignedByIsNil applies the IsNil predicate on the "assigned_by" field.
|
||||
func AssignedByIsNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIsNull(FieldAssignedBy))
|
||||
}
|
||||
|
||||
// AssignedByNotNil applies the NotNil predicate on the "assigned_by" field.
|
||||
func AssignedByNotNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotNull(FieldAssignedBy))
|
||||
}
|
||||
|
||||
// AssignedAtEQ applies the EQ predicate on the "assigned_at" field.
|
||||
func AssignedAtEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// AssignedAtNEQ applies the NEQ predicate on the "assigned_at" field.
|
||||
func AssignedAtNEQ(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// AssignedAtIn applies the In predicate on the "assigned_at" field.
|
||||
func AssignedAtIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldAssignedAt, vs...))
|
||||
}
|
||||
|
||||
// AssignedAtNotIn applies the NotIn predicate on the "assigned_at" field.
|
||||
func AssignedAtNotIn(vs ...time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldAssignedAt, vs...))
|
||||
}
|
||||
|
||||
// AssignedAtGT applies the GT predicate on the "assigned_at" field.
|
||||
func AssignedAtGT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// AssignedAtGTE applies the GTE predicate on the "assigned_at" field.
|
||||
func AssignedAtGTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// AssignedAtLT applies the LT predicate on the "assigned_at" field.
|
||||
func AssignedAtLT(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// AssignedAtLTE applies the LTE predicate on the "assigned_at" field.
|
||||
func AssignedAtLTE(v time.Time) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldAssignedAt, v))
|
||||
}
|
||||
|
||||
// NotesEQ applies the EQ predicate on the "notes" field.
|
||||
func NotesEQ(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEQ(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesNEQ applies the NEQ predicate on the "notes" field.
|
||||
func NotesNEQ(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNEQ(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesIn applies the In predicate on the "notes" field.
|
||||
func NotesIn(vs ...string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIn(FieldNotes, vs...))
|
||||
}
|
||||
|
||||
// NotesNotIn applies the NotIn predicate on the "notes" field.
|
||||
func NotesNotIn(vs ...string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotIn(FieldNotes, vs...))
|
||||
}
|
||||
|
||||
// NotesGT applies the GT predicate on the "notes" field.
|
||||
func NotesGT(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGT(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesGTE applies the GTE predicate on the "notes" field.
|
||||
func NotesGTE(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldGTE(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesLT applies the LT predicate on the "notes" field.
|
||||
func NotesLT(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLT(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesLTE applies the LTE predicate on the "notes" field.
|
||||
func NotesLTE(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldLTE(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesContains applies the Contains predicate on the "notes" field.
|
||||
func NotesContains(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldContains(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesHasPrefix applies the HasPrefix predicate on the "notes" field.
|
||||
func NotesHasPrefix(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldHasPrefix(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesHasSuffix applies the HasSuffix predicate on the "notes" field.
|
||||
func NotesHasSuffix(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldHasSuffix(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesIsNil applies the IsNil predicate on the "notes" field.
|
||||
func NotesIsNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldIsNull(FieldNotes))
|
||||
}
|
||||
|
||||
// NotesNotNil applies the NotNil predicate on the "notes" field.
|
||||
func NotesNotNil() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldNotNull(FieldNotes))
|
||||
}
|
||||
|
||||
// NotesEqualFold applies the EqualFold predicate on the "notes" field.
|
||||
func NotesEqualFold(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldEqualFold(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesContainsFold applies the ContainsFold predicate on the "notes" field.
|
||||
func NotesContainsFold(v string) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.FieldContainsFold(FieldNotes, v))
|
||||
}
|
||||
|
||||
// HasUser applies the HasEdge predicate on the "user" edge.
|
||||
func HasUser() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
|
||||
func HasUserWith(preds ...predicate.User) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(func(s *sql.Selector) {
|
||||
step := newUserStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasGroup applies the HasEdge predicate on the "group" edge.
|
||||
func HasGroup() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, GroupTable, GroupColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates).
|
||||
func HasGroupWith(preds ...predicate.Group) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(func(s *sql.Selector) {
|
||||
step := newGroupStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasAssignedByUser applies the HasEdge predicate on the "assigned_by_user" edge.
|
||||
func HasAssignedByUser() predicate.UserSubscription {
|
||||
return predicate.UserSubscription(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, AssignedByUserTable, AssignedByUserColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasAssignedByUserWith applies the HasEdge predicate on the "assigned_by_user" edge with a given conditions (other predicates).
|
||||
func HasAssignedByUserWith(preds ...predicate.User) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(func(s *sql.Selector) {
|
||||
step := newAssignedByUserStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.UserSubscription) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.UserSubscription) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.UserSubscription) predicate.UserSubscription {
|
||||
return predicate.UserSubscription(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user