1284 lines
42 KiB
Go
1284 lines
42 KiB
Go
// Code generated by BobGen psql v0.0.3-0.20251202003046-49148fc66a73+dirty. 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 HistoryLocationtrackingMod interface {
|
|
Apply(context.Context, *HistoryLocationtrackingTemplate)
|
|
}
|
|
|
|
type HistoryLocationtrackingModFunc func(context.Context, *HistoryLocationtrackingTemplate)
|
|
|
|
func (f HistoryLocationtrackingModFunc) Apply(ctx context.Context, n *HistoryLocationtrackingTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type HistoryLocationtrackingModSlice []HistoryLocationtrackingMod
|
|
|
|
func (mods HistoryLocationtrackingModSlice) Apply(ctx context.Context, n *HistoryLocationtrackingTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// HistoryLocationtrackingTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type HistoryLocationtrackingTemplate struct {
|
|
OrganizationID func() int32
|
|
Accuracy func() null.Val[float64]
|
|
Creationdate func() null.Val[int64]
|
|
Creator func() null.Val[string]
|
|
Editdate func() null.Val[int64]
|
|
Editor func() null.Val[string]
|
|
Fieldtech func() null.Val[string]
|
|
Globalid func() null.Val[string]
|
|
Objectid func() int32
|
|
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 historyLocationtrackingR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type historyLocationtrackingR struct {
|
|
Organization *historyLocationtrackingROrganizationR
|
|
}
|
|
|
|
type historyLocationtrackingROrganizationR struct {
|
|
o *OrganizationTemplate
|
|
}
|
|
|
|
// Apply mods to the HistoryLocationtrackingTemplate
|
|
func (o *HistoryLocationtrackingTemplate) Apply(ctx context.Context, mods ...HistoryLocationtrackingMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.HistoryLocationtracking
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t HistoryLocationtrackingTemplate) setModelRels(o *models.HistoryLocationtracking) {
|
|
if t.r.Organization != nil {
|
|
rel := t.r.Organization.o.Build()
|
|
rel.R.HistoryLocationtrackings = append(rel.R.HistoryLocationtrackings, o)
|
|
o.OrganizationID = rel.ID // h2
|
|
o.R.Organization = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.HistoryLocationtrackingSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryLocationtrackingTemplate) BuildSetter() *models.HistoryLocationtrackingSetter {
|
|
m := &models.HistoryLocationtrackingSetter{}
|
|
|
|
if o.OrganizationID != nil {
|
|
val := o.OrganizationID()
|
|
m.OrganizationID = omit.From(val)
|
|
}
|
|
if o.Accuracy != nil {
|
|
val := o.Accuracy()
|
|
m.Accuracy = omitnull.FromNull(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.Fieldtech != nil {
|
|
val := o.Fieldtech()
|
|
m.Fieldtech = 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.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.HistoryLocationtrackingSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryLocationtrackingTemplate) BuildManySetter(number int) []*models.HistoryLocationtrackingSetter {
|
|
m := make([]*models.HistoryLocationtrackingSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.HistoryLocationtracking
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryLocationtrackingTemplate.Create
|
|
func (o HistoryLocationtrackingTemplate) Build() *models.HistoryLocationtracking {
|
|
m := &models.HistoryLocationtracking{}
|
|
|
|
if o.OrganizationID != nil {
|
|
m.OrganizationID = o.OrganizationID()
|
|
}
|
|
if o.Accuracy != nil {
|
|
m.Accuracy = o.Accuracy()
|
|
}
|
|
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.Fieldtech != nil {
|
|
m.Fieldtech = o.Fieldtech()
|
|
}
|
|
if o.Globalid != nil {
|
|
m.Globalid = o.Globalid()
|
|
}
|
|
if o.Objectid != nil {
|
|
m.Objectid = o.Objectid()
|
|
}
|
|
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.HistoryLocationtrackingSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryLocationtrackingTemplate.CreateMany
|
|
func (o HistoryLocationtrackingTemplate) BuildMany(number int) models.HistoryLocationtrackingSlice {
|
|
m := make(models.HistoryLocationtrackingSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableHistoryLocationtracking(m *models.HistoryLocationtrackingSetter) {
|
|
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.HistoryLocationtracking
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *HistoryLocationtrackingTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryLocationtracking) error {
|
|
var err error
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a historyLocationtracking and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *HistoryLocationtrackingTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryLocationtracking, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableHistoryLocationtracking(opt)
|
|
|
|
if o.r.Organization == nil {
|
|
HistoryLocationtrackingMods.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.HistoryLocationtrackings.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 historyLocationtracking and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *HistoryLocationtrackingTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryLocationtracking {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a historyLocationtracking 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 *HistoryLocationtrackingTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryLocationtracking {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple historyLocationtrackings and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o HistoryLocationtrackingTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryLocationtrackingSlice, error) {
|
|
var err error
|
|
m := make(models.HistoryLocationtrackingSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple historyLocationtrackings and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o HistoryLocationtrackingTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryLocationtrackingSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple historyLocationtrackings 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 HistoryLocationtrackingTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryLocationtrackingSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// HistoryLocationtracking has methods that act as mods for the HistoryLocationtrackingTemplate
|
|
var HistoryLocationtrackingMods historyLocationtrackingMods
|
|
|
|
type historyLocationtrackingMods struct{}
|
|
|
|
func (m historyLocationtrackingMods) RandomizeAllColumns(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModSlice{
|
|
HistoryLocationtrackingMods.RandomOrganizationID(f),
|
|
HistoryLocationtrackingMods.RandomAccuracy(f),
|
|
HistoryLocationtrackingMods.RandomCreationdate(f),
|
|
HistoryLocationtrackingMods.RandomCreator(f),
|
|
HistoryLocationtrackingMods.RandomEditdate(f),
|
|
HistoryLocationtrackingMods.RandomEditor(f),
|
|
HistoryLocationtrackingMods.RandomFieldtech(f),
|
|
HistoryLocationtrackingMods.RandomGlobalid(f),
|
|
HistoryLocationtrackingMods.RandomObjectid(f),
|
|
HistoryLocationtrackingMods.RandomCreated(f),
|
|
HistoryLocationtrackingMods.RandomCreatedDate(f),
|
|
HistoryLocationtrackingMods.RandomCreatedUser(f),
|
|
HistoryLocationtrackingMods.RandomGeometryX(f),
|
|
HistoryLocationtrackingMods.RandomGeometryY(f),
|
|
HistoryLocationtrackingMods.RandomLastEditedDate(f),
|
|
HistoryLocationtrackingMods.RandomLastEditedUser(f),
|
|
HistoryLocationtrackingMods.RandomVersion(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyLocationtrackingMods) OrganizationID(val int32) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.OrganizationID = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) OrganizationIDFunc(f func() int32) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.OrganizationID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetOrganizationID() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomOrganizationID(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.OrganizationID = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyLocationtrackingMods) Accuracy(val null.Val[float64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Accuracy = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) AccuracyFunc(f func() null.Val[float64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Accuracy = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetAccuracy() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Accuracy = 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 historyLocationtrackingMods) RandomAccuracy(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Accuracy = 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 historyLocationtrackingMods) RandomAccuracyNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Accuracy = 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 historyLocationtrackingMods) Creationdate(val null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) CreationdateFunc(f func() null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Creationdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetCreationdate() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreationdate(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreationdateNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) Creator(val null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Creator = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) CreatorFunc(f func() null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Creator = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetCreator() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreator(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreatorNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) Editdate(val null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) EditdateFunc(f func() null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Editdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetEditdate() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomEditdate(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomEditdateNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) Editor(val null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Editor = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) EditorFunc(f func() null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Editor = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetEditor() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomEditor(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomEditorNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) Fieldtech(val null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Fieldtech = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) FieldtechFunc(f func() null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Fieldtech = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetFieldtech() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Fieldtech = 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 historyLocationtrackingMods) RandomFieldtech(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Fieldtech = 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 historyLocationtrackingMods) RandomFieldtechNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Fieldtech = 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 historyLocationtrackingMods) Globalid(val null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) GlobalidFunc(f func() null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Globalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetGlobalid() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomGlobalid(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomGlobalidNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) Objectid(val int32) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Objectid = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) ObjectidFunc(f func() int32) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Objectid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetObjectid() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomObjectid(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Objectid = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyLocationtrackingMods) Created(val null.Val[time.Time]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Created = func() null.Val[time.Time] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) CreatedFunc(f func() null.Val[time.Time]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Created = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetCreated() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreated(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreatedNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) CreatedDate(val null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) CreatedDateFunc(f func() null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.CreatedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetCreatedDate() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreatedDate(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) CreatedUser(val null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) CreatedUserFunc(f func() null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.CreatedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetCreatedUser() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreatedUser(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) GeometryX(val null.Val[float64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) GeometryXFunc(f func() null.Val[float64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.GeometryX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetGeometryX() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomGeometryX(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomGeometryXNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) GeometryY(val null.Val[float64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) GeometryYFunc(f func() null.Val[float64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.GeometryY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetGeometryY() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomGeometryY(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomGeometryYNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) LastEditedDate(val null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.LastEditedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetLastEditedDate() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomLastEditedDate(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) LastEditedUser(val null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) LastEditedUserFunc(f func() null.Val[string]) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.LastEditedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetLastEditedUser() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomLastEditedUser(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) Version(val int32) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Version = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyLocationtrackingMods) VersionFunc(f func() int32) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Version = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyLocationtrackingMods) UnsetVersion() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
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 historyLocationtrackingMods) RandomVersion(f *faker.Faker) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(_ context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.Version = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyLocationtrackingMods) WithParentsCascading() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(ctx context.Context, o *HistoryLocationtrackingTemplate) {
|
|
if isDone, _ := historyLocationtrackingWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = historyLocationtrackingWithParentsCascadingCtx.WithValue(ctx, true)
|
|
{
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyLocationtrackingMods) WithOrganization(rel *OrganizationTemplate) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(ctx context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.r.Organization = &historyLocationtrackingROrganizationR{
|
|
o: rel,
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyLocationtrackingMods) WithNewOrganization(mods ...OrganizationMod) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(ctx context.Context, o *HistoryLocationtrackingTemplate) {
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m historyLocationtrackingMods) WithExistingOrganization(em *models.Organization) HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(ctx context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.r.Organization = &historyLocationtrackingROrganizationR{
|
|
o: o.f.FromExistingOrganization(em),
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyLocationtrackingMods) WithoutOrganization() HistoryLocationtrackingMod {
|
|
return HistoryLocationtrackingModFunc(func(ctx context.Context, o *HistoryLocationtrackingTemplate) {
|
|
o.r.Organization = nil
|
|
})
|
|
}
|