This is an intermediate step between shifting from the old fs_* prefixed table names to an entire fieldseeker schema. At this point we have both, and we aren't doing much with the new schema but compiling.
1222 lines
40 KiB
Go
1222 lines
40 KiB
Go
// Code generated by BobGen psql v0.42.0. DO NOT EDIT.
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
package factory
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
models "github.com/Gleipnir-Technology/nidus-sync/db/models"
|
|
"github.com/aarondl/opt/null"
|
|
"github.com/aarondl/opt/omit"
|
|
"github.com/aarondl/opt/omitnull"
|
|
"github.com/jaswdr/faker/v2"
|
|
"github.com/stephenafamo/bob"
|
|
)
|
|
|
|
type HistoryFieldscoutinglogMod interface {
|
|
Apply(context.Context, *HistoryFieldscoutinglogTemplate)
|
|
}
|
|
|
|
type HistoryFieldscoutinglogModFunc func(context.Context, *HistoryFieldscoutinglogTemplate)
|
|
|
|
func (f HistoryFieldscoutinglogModFunc) Apply(ctx context.Context, n *HistoryFieldscoutinglogTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type HistoryFieldscoutinglogModSlice []HistoryFieldscoutinglogMod
|
|
|
|
func (mods HistoryFieldscoutinglogModSlice) Apply(ctx context.Context, n *HistoryFieldscoutinglogTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// HistoryFieldscoutinglogTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type HistoryFieldscoutinglogTemplate struct {
|
|
OrganizationID func() int32
|
|
Creationdate func() null.Val[int64]
|
|
Creator func() null.Val[string]
|
|
Editdate func() null.Val[int64]
|
|
Editor func() null.Val[string]
|
|
Globalid func() null.Val[string]
|
|
Objectid func() int32
|
|
Status func() null.Val[int16]
|
|
Created func() null.Val[time.Time]
|
|
CreatedDate func() null.Val[int64]
|
|
CreatedUser func() null.Val[string]
|
|
GeometryX func() null.Val[float64]
|
|
GeometryY func() null.Val[float64]
|
|
LastEditedDate func() null.Val[int64]
|
|
LastEditedUser func() null.Val[string]
|
|
Version func() int32
|
|
|
|
r historyFieldscoutinglogR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type historyFieldscoutinglogR struct {
|
|
Organization *historyFieldscoutinglogROrganizationR
|
|
}
|
|
|
|
type historyFieldscoutinglogROrganizationR struct {
|
|
o *OrganizationTemplate
|
|
}
|
|
|
|
// Apply mods to the HistoryFieldscoutinglogTemplate
|
|
func (o *HistoryFieldscoutinglogTemplate) Apply(ctx context.Context, mods ...HistoryFieldscoutinglogMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.HistoryFieldscoutinglog
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t HistoryFieldscoutinglogTemplate) setModelRels(o *models.HistoryFieldscoutinglog) {
|
|
if t.r.Organization != nil {
|
|
rel := t.r.Organization.o.Build()
|
|
rel.R.HistoryFieldscoutinglogs = append(rel.R.HistoryFieldscoutinglogs, o)
|
|
o.OrganizationID = rel.ID // h2
|
|
o.R.Organization = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.HistoryFieldscoutinglogSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryFieldscoutinglogTemplate) BuildSetter() *models.HistoryFieldscoutinglogSetter {
|
|
m := &models.HistoryFieldscoutinglogSetter{}
|
|
|
|
if o.OrganizationID != nil {
|
|
val := o.OrganizationID()
|
|
m.OrganizationID = omit.From(val)
|
|
}
|
|
if o.Creationdate != nil {
|
|
val := o.Creationdate()
|
|
m.Creationdate = omitnull.FromNull(val)
|
|
}
|
|
if o.Creator != nil {
|
|
val := o.Creator()
|
|
m.Creator = omitnull.FromNull(val)
|
|
}
|
|
if o.Editdate != nil {
|
|
val := o.Editdate()
|
|
m.Editdate = omitnull.FromNull(val)
|
|
}
|
|
if o.Editor != nil {
|
|
val := o.Editor()
|
|
m.Editor = omitnull.FromNull(val)
|
|
}
|
|
if o.Globalid != nil {
|
|
val := o.Globalid()
|
|
m.Globalid = omitnull.FromNull(val)
|
|
}
|
|
if o.Objectid != nil {
|
|
val := o.Objectid()
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
if o.Status != nil {
|
|
val := o.Status()
|
|
m.Status = omitnull.FromNull(val)
|
|
}
|
|
if o.Created != nil {
|
|
val := o.Created()
|
|
m.Created = omitnull.FromNull(val)
|
|
}
|
|
if o.CreatedDate != nil {
|
|
val := o.CreatedDate()
|
|
m.CreatedDate = omitnull.FromNull(val)
|
|
}
|
|
if o.CreatedUser != nil {
|
|
val := o.CreatedUser()
|
|
m.CreatedUser = omitnull.FromNull(val)
|
|
}
|
|
if o.GeometryX != nil {
|
|
val := o.GeometryX()
|
|
m.GeometryX = omitnull.FromNull(val)
|
|
}
|
|
if o.GeometryY != nil {
|
|
val := o.GeometryY()
|
|
m.GeometryY = omitnull.FromNull(val)
|
|
}
|
|
if o.LastEditedDate != nil {
|
|
val := o.LastEditedDate()
|
|
m.LastEditedDate = omitnull.FromNull(val)
|
|
}
|
|
if o.LastEditedUser != nil {
|
|
val := o.LastEditedUser()
|
|
m.LastEditedUser = omitnull.FromNull(val)
|
|
}
|
|
if o.Version != nil {
|
|
val := o.Version()
|
|
m.Version = omit.From(val)
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildManySetter returns an []*models.HistoryFieldscoutinglogSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryFieldscoutinglogTemplate) BuildManySetter(number int) []*models.HistoryFieldscoutinglogSetter {
|
|
m := make([]*models.HistoryFieldscoutinglogSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.HistoryFieldscoutinglog
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryFieldscoutinglogTemplate.Create
|
|
func (o HistoryFieldscoutinglogTemplate) Build() *models.HistoryFieldscoutinglog {
|
|
m := &models.HistoryFieldscoutinglog{}
|
|
|
|
if o.OrganizationID != nil {
|
|
m.OrganizationID = o.OrganizationID()
|
|
}
|
|
if o.Creationdate != nil {
|
|
m.Creationdate = o.Creationdate()
|
|
}
|
|
if o.Creator != nil {
|
|
m.Creator = o.Creator()
|
|
}
|
|
if o.Editdate != nil {
|
|
m.Editdate = o.Editdate()
|
|
}
|
|
if o.Editor != nil {
|
|
m.Editor = o.Editor()
|
|
}
|
|
if o.Globalid != nil {
|
|
m.Globalid = o.Globalid()
|
|
}
|
|
if o.Objectid != nil {
|
|
m.Objectid = o.Objectid()
|
|
}
|
|
if o.Status != nil {
|
|
m.Status = o.Status()
|
|
}
|
|
if o.Created != nil {
|
|
m.Created = o.Created()
|
|
}
|
|
if o.CreatedDate != nil {
|
|
m.CreatedDate = o.CreatedDate()
|
|
}
|
|
if o.CreatedUser != nil {
|
|
m.CreatedUser = o.CreatedUser()
|
|
}
|
|
if o.GeometryX != nil {
|
|
m.GeometryX = o.GeometryX()
|
|
}
|
|
if o.GeometryY != nil {
|
|
m.GeometryY = o.GeometryY()
|
|
}
|
|
if o.LastEditedDate != nil {
|
|
m.LastEditedDate = o.LastEditedDate()
|
|
}
|
|
if o.LastEditedUser != nil {
|
|
m.LastEditedUser = o.LastEditedUser()
|
|
}
|
|
if o.Version != nil {
|
|
m.Version = o.Version()
|
|
}
|
|
|
|
o.setModelRels(m)
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildMany returns an models.HistoryFieldscoutinglogSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryFieldscoutinglogTemplate.CreateMany
|
|
func (o HistoryFieldscoutinglogTemplate) BuildMany(number int) models.HistoryFieldscoutinglogSlice {
|
|
m := make(models.HistoryFieldscoutinglogSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableHistoryFieldscoutinglog(m *models.HistoryFieldscoutinglogSetter) {
|
|
if !(m.OrganizationID.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.OrganizationID = omit.From(val)
|
|
}
|
|
if !(m.Objectid.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
if !(m.Version.IsValue()) {
|
|
val := random_int32(nil)
|
|
m.Version = omit.From(val)
|
|
}
|
|
}
|
|
|
|
// insertOptRels creates and inserts any optional the relationships on *models.HistoryFieldscoutinglog
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *HistoryFieldscoutinglogTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryFieldscoutinglog) error {
|
|
var err error
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a historyFieldscoutinglog and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *HistoryFieldscoutinglogTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryFieldscoutinglog, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableHistoryFieldscoutinglog(opt)
|
|
|
|
if o.r.Organization == nil {
|
|
HistoryFieldscoutinglogMods.WithNewOrganization().Apply(ctx, o)
|
|
}
|
|
|
|
var rel0 *models.Organization
|
|
|
|
if o.r.Organization.o.alreadyPersisted {
|
|
rel0 = o.r.Organization.o.Build()
|
|
} else {
|
|
rel0, err = o.r.Organization.o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
opt.OrganizationID = omit.From(rel0.ID)
|
|
|
|
m, err := models.HistoryFieldscoutinglogs.Insert(opt).One(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
m.R.Organization = rel0
|
|
|
|
if err := o.insertOptRels(ctx, exec, m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, err
|
|
}
|
|
|
|
// MustCreate builds a historyFieldscoutinglog and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *HistoryFieldscoutinglogTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryFieldscoutinglog {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a historyFieldscoutinglog and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
|
|
func (o *HistoryFieldscoutinglogTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryFieldscoutinglog {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple historyFieldscoutinglogs and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o HistoryFieldscoutinglogTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryFieldscoutinglogSlice, error) {
|
|
var err error
|
|
m := make(models.HistoryFieldscoutinglogSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple historyFieldscoutinglogs and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o HistoryFieldscoutinglogTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryFieldscoutinglogSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple historyFieldscoutinglogs and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
|
|
func (o HistoryFieldscoutinglogTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryFieldscoutinglogSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// HistoryFieldscoutinglog has methods that act as mods for the HistoryFieldscoutinglogTemplate
|
|
var HistoryFieldscoutinglogMods historyFieldscoutinglogMods
|
|
|
|
type historyFieldscoutinglogMods struct{}
|
|
|
|
func (m historyFieldscoutinglogMods) RandomizeAllColumns(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModSlice{
|
|
HistoryFieldscoutinglogMods.RandomOrganizationID(f),
|
|
HistoryFieldscoutinglogMods.RandomCreationdate(f),
|
|
HistoryFieldscoutinglogMods.RandomCreator(f),
|
|
HistoryFieldscoutinglogMods.RandomEditdate(f),
|
|
HistoryFieldscoutinglogMods.RandomEditor(f),
|
|
HistoryFieldscoutinglogMods.RandomGlobalid(f),
|
|
HistoryFieldscoutinglogMods.RandomObjectid(f),
|
|
HistoryFieldscoutinglogMods.RandomStatus(f),
|
|
HistoryFieldscoutinglogMods.RandomCreated(f),
|
|
HistoryFieldscoutinglogMods.RandomCreatedDate(f),
|
|
HistoryFieldscoutinglogMods.RandomCreatedUser(f),
|
|
HistoryFieldscoutinglogMods.RandomGeometryX(f),
|
|
HistoryFieldscoutinglogMods.RandomGeometryY(f),
|
|
HistoryFieldscoutinglogMods.RandomLastEditedDate(f),
|
|
HistoryFieldscoutinglogMods.RandomLastEditedUser(f),
|
|
HistoryFieldscoutinglogMods.RandomVersion(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) OrganizationID(val int32) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.OrganizationID = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) OrganizationIDFunc(f func() int32) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.OrganizationID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetOrganizationID() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.OrganizationID = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m historyFieldscoutinglogMods) RandomOrganizationID(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.OrganizationID = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Creationdate(val null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) CreationdateFunc(f func() null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creationdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetCreationdate() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creationdate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomCreationdate(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creationdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomCreationdateNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creationdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Creator(val null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creator = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) CreatorFunc(f func() null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creator = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetCreator() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creator = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomCreator(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creator = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomCreatorNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Creator = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Editdate(val null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) EditdateFunc(f func() null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetEditdate() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editdate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomEditdate(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomEditdateNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editdate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Editor(val null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editor = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) EditorFunc(f func() null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editor = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetEditor() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editor = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomEditor(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editor = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomEditorNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Editor = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Globalid(val null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) GlobalidFunc(f func() null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Globalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetGlobalid() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Globalid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomGlobalid(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Globalid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomGlobalidNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Globalid = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Objectid(val int32) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Objectid = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) ObjectidFunc(f func() int32) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Objectid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetObjectid() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Objectid = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m historyFieldscoutinglogMods) RandomObjectid(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Objectid = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Status(val null.Val[int16]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Status = func() null.Val[int16] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) StatusFunc(f func() null.Val[int16]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Status = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetStatus() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Status = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomStatus(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Status = func() null.Val[int16] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int16(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomStatusNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Status = func() null.Val[int16] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int16(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Created(val null.Val[time.Time]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Created = func() null.Val[time.Time] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) CreatedFunc(f func() null.Val[time.Time]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Created = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetCreated() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Created = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomCreated(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Created = func() null.Val[time.Time] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_time_Time(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomCreatedNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Created = func() null.Val[time.Time] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_time_Time(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) CreatedDate(val null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) CreatedDateFunc(f func() null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetCreatedDate() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedDate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomCreatedDate(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) CreatedUser(val null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) CreatedUserFunc(f func() null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetCreatedUser() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedUser = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomCreatedUser(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.CreatedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) GeometryX(val null.Val[float64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) GeometryXFunc(f func() null.Val[float64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetGeometryX() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryX = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomGeometryX(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryX = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomGeometryXNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryX = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) GeometryY(val null.Val[float64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) GeometryYFunc(f func() null.Val[float64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetGeometryY() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryY = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomGeometryY(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryY = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomGeometryYNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.GeometryY = func() null.Val[float64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_float64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) LastEditedDate(val null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetLastEditedDate() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedDate = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomLastEditedDate(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_int64(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) LastEditedUser(val null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) LastEditedUserFunc(f func() null.Val[string]) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetLastEditedUser() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedUser = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is sometimes null
|
|
func (m historyFieldscoutinglogMods) RandomLastEditedUser(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
// The generated value is never null
|
|
func (m historyFieldscoutinglogMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_string(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyFieldscoutinglogMods) Version(val int32) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Version = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyFieldscoutinglogMods) VersionFunc(f func() int32) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Version = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyFieldscoutinglogMods) UnsetVersion() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Version = nil
|
|
})
|
|
}
|
|
|
|
// Generates a random value for the column using the given faker
|
|
// if faker is nil, a default faker is used
|
|
func (m historyFieldscoutinglogMods) RandomVersion(f *faker.Faker) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(_ context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.Version = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyFieldscoutinglogMods) WithParentsCascading() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(ctx context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
if isDone, _ := historyFieldscoutinglogWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = historyFieldscoutinglogWithParentsCascadingCtx.WithValue(ctx, true)
|
|
{
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyFieldscoutinglogMods) WithOrganization(rel *OrganizationTemplate) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(ctx context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.r.Organization = &historyFieldscoutinglogROrganizationR{
|
|
o: rel,
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyFieldscoutinglogMods) WithNewOrganization(mods ...OrganizationMod) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(ctx context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m historyFieldscoutinglogMods) WithExistingOrganization(em *models.Organization) HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(ctx context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.r.Organization = &historyFieldscoutinglogROrganizationR{
|
|
o: o.f.FromExistingOrganization(em),
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyFieldscoutinglogMods) WithoutOrganization() HistoryFieldscoutinglogMod {
|
|
return HistoryFieldscoutinglogModFunc(func(ctx context.Context, o *HistoryFieldscoutinglogTemplate) {
|
|
o.r.Organization = nil
|
|
})
|
|
}
|