We need the org ID so that we can avoid bleedover between different organizations.
1718 lines
52 KiB
Go
1718 lines
52 KiB
Go
// Code generated by BobGen psql v0.41.1. 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/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 HistoryStormdrainMod interface {
|
|
Apply(context.Context, *HistoryStormdrainTemplate)
|
|
}
|
|
|
|
type HistoryStormdrainModFunc func(context.Context, *HistoryStormdrainTemplate)
|
|
|
|
func (f HistoryStormdrainModFunc) Apply(ctx context.Context, n *HistoryStormdrainTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type HistoryStormdrainModSlice []HistoryStormdrainMod
|
|
|
|
func (mods HistoryStormdrainModSlice) Apply(ctx context.Context, n *HistoryStormdrainTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// HistoryStormdrainTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type HistoryStormdrainTemplate 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]
|
|
Jurisdiction func() null.Val[string]
|
|
Lastaction func() null.Val[string]
|
|
Laststatus func() null.Val[string]
|
|
Lasttreatdate func() null.Val[int64]
|
|
Nexttreatmentdate func() null.Val[int64]
|
|
Objectid func() int32
|
|
Symbology func() null.Val[string]
|
|
Type func() null.Val[string]
|
|
Zone func() null.Val[string]
|
|
Zone2 func() null.Val[string]
|
|
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 historyStormdrainR
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
type historyStormdrainR struct {
|
|
Organization *historyStormdrainROrganizationR
|
|
}
|
|
|
|
type historyStormdrainROrganizationR struct {
|
|
o *OrganizationTemplate
|
|
}
|
|
|
|
// Apply mods to the HistoryStormdrainTemplate
|
|
func (o *HistoryStormdrainTemplate) Apply(ctx context.Context, mods ...HistoryStormdrainMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.HistoryStormdrain
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t HistoryStormdrainTemplate) setModelRels(o *models.HistoryStormdrain) {
|
|
if t.r.Organization != nil {
|
|
rel := t.r.Organization.o.Build()
|
|
rel.R.HistoryStormdrains = append(rel.R.HistoryStormdrains, o)
|
|
o.OrganizationID = rel.ID // h2
|
|
o.R.Organization = rel
|
|
}
|
|
}
|
|
|
|
// BuildSetter returns an *models.HistoryStormdrainSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryStormdrainTemplate) BuildSetter() *models.HistoryStormdrainSetter {
|
|
m := &models.HistoryStormdrainSetter{}
|
|
|
|
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.Jurisdiction != nil {
|
|
val := o.Jurisdiction()
|
|
m.Jurisdiction = omitnull.FromNull(val)
|
|
}
|
|
if o.Lastaction != nil {
|
|
val := o.Lastaction()
|
|
m.Lastaction = omitnull.FromNull(val)
|
|
}
|
|
if o.Laststatus != nil {
|
|
val := o.Laststatus()
|
|
m.Laststatus = omitnull.FromNull(val)
|
|
}
|
|
if o.Lasttreatdate != nil {
|
|
val := o.Lasttreatdate()
|
|
m.Lasttreatdate = omitnull.FromNull(val)
|
|
}
|
|
if o.Nexttreatmentdate != nil {
|
|
val := o.Nexttreatmentdate()
|
|
m.Nexttreatmentdate = omitnull.FromNull(val)
|
|
}
|
|
if o.Objectid != nil {
|
|
val := o.Objectid()
|
|
m.Objectid = omit.From(val)
|
|
}
|
|
if o.Symbology != nil {
|
|
val := o.Symbology()
|
|
m.Symbology = omitnull.FromNull(val)
|
|
}
|
|
if o.Type != nil {
|
|
val := o.Type()
|
|
m.Type = omitnull.FromNull(val)
|
|
}
|
|
if o.Zone != nil {
|
|
val := o.Zone()
|
|
m.Zone = omitnull.FromNull(val)
|
|
}
|
|
if o.Zone2 != nil {
|
|
val := o.Zone2()
|
|
m.Zone2 = 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.HistoryStormdrainSetter
|
|
// this does nothing with the relationship templates
|
|
func (o HistoryStormdrainTemplate) BuildManySetter(number int) []*models.HistoryStormdrainSetter {
|
|
m := make([]*models.HistoryStormdrainSetter, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.BuildSetter()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// Build returns an *models.HistoryStormdrain
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryStormdrainTemplate.Create
|
|
func (o HistoryStormdrainTemplate) Build() *models.HistoryStormdrain {
|
|
m := &models.HistoryStormdrain{}
|
|
|
|
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.Jurisdiction != nil {
|
|
m.Jurisdiction = o.Jurisdiction()
|
|
}
|
|
if o.Lastaction != nil {
|
|
m.Lastaction = o.Lastaction()
|
|
}
|
|
if o.Laststatus != nil {
|
|
m.Laststatus = o.Laststatus()
|
|
}
|
|
if o.Lasttreatdate != nil {
|
|
m.Lasttreatdate = o.Lasttreatdate()
|
|
}
|
|
if o.Nexttreatmentdate != nil {
|
|
m.Nexttreatmentdate = o.Nexttreatmentdate()
|
|
}
|
|
if o.Objectid != nil {
|
|
m.Objectid = o.Objectid()
|
|
}
|
|
if o.Symbology != nil {
|
|
m.Symbology = o.Symbology()
|
|
}
|
|
if o.Type != nil {
|
|
m.Type = o.Type()
|
|
}
|
|
if o.Zone != nil {
|
|
m.Zone = o.Zone()
|
|
}
|
|
if o.Zone2 != nil {
|
|
m.Zone2 = o.Zone2()
|
|
}
|
|
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.HistoryStormdrainSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use HistoryStormdrainTemplate.CreateMany
|
|
func (o HistoryStormdrainTemplate) BuildMany(number int) models.HistoryStormdrainSlice {
|
|
m := make(models.HistoryStormdrainSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
func ensureCreatableHistoryStormdrain(m *models.HistoryStormdrainSetter) {
|
|
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.HistoryStormdrain
|
|
// according to the relationships in the template.
|
|
// any required relationship should have already exist on the model
|
|
func (o *HistoryStormdrainTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryStormdrain) error {
|
|
var err error
|
|
|
|
return err
|
|
}
|
|
|
|
// Create builds a historyStormdrain and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o *HistoryStormdrainTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryStormdrain, error) {
|
|
var err error
|
|
opt := o.BuildSetter()
|
|
ensureCreatableHistoryStormdrain(opt)
|
|
|
|
if o.r.Organization == nil {
|
|
HistoryStormdrainMods.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.HistoryStormdrains.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 historyStormdrain and inserts it into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o *HistoryStormdrainTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryStormdrain {
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateOrFail builds a historyStormdrain 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 *HistoryStormdrainTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryStormdrain {
|
|
tb.Helper()
|
|
m, err := o.Create(ctx, exec)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateMany builds multiple historyStormdrains and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
func (o HistoryStormdrainTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryStormdrainSlice, error) {
|
|
var err error
|
|
m := make(models.HistoryStormdrainSlice, number)
|
|
|
|
for i := range m {
|
|
m[i], err = o.Create(ctx, exec)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
return m, nil
|
|
}
|
|
|
|
// MustCreateMany builds multiple historyStormdrains and inserts them into the database
|
|
// Relations objects are also inserted and placed in the .R field
|
|
// panics if an error occurs
|
|
func (o HistoryStormdrainTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryStormdrainSlice {
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// CreateManyOrFail builds multiple historyStormdrains 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 HistoryStormdrainTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryStormdrainSlice {
|
|
tb.Helper()
|
|
m, err := o.CreateMany(ctx, exec, number)
|
|
if err != nil {
|
|
tb.Fatal(err)
|
|
return nil
|
|
}
|
|
return m
|
|
}
|
|
|
|
// HistoryStormdrain has methods that act as mods for the HistoryStormdrainTemplate
|
|
var HistoryStormdrainMods historyStormdrainMods
|
|
|
|
type historyStormdrainMods struct{}
|
|
|
|
func (m historyStormdrainMods) RandomizeAllColumns(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModSlice{
|
|
HistoryStormdrainMods.RandomOrganizationID(f),
|
|
HistoryStormdrainMods.RandomCreationdate(f),
|
|
HistoryStormdrainMods.RandomCreator(f),
|
|
HistoryStormdrainMods.RandomEditdate(f),
|
|
HistoryStormdrainMods.RandomEditor(f),
|
|
HistoryStormdrainMods.RandomGlobalid(f),
|
|
HistoryStormdrainMods.RandomJurisdiction(f),
|
|
HistoryStormdrainMods.RandomLastaction(f),
|
|
HistoryStormdrainMods.RandomLaststatus(f),
|
|
HistoryStormdrainMods.RandomLasttreatdate(f),
|
|
HistoryStormdrainMods.RandomNexttreatmentdate(f),
|
|
HistoryStormdrainMods.RandomObjectid(f),
|
|
HistoryStormdrainMods.RandomSymbology(f),
|
|
HistoryStormdrainMods.RandomType(f),
|
|
HistoryStormdrainMods.RandomZone(f),
|
|
HistoryStormdrainMods.RandomZone2(f),
|
|
HistoryStormdrainMods.RandomCreated(f),
|
|
HistoryStormdrainMods.RandomCreatedDate(f),
|
|
HistoryStormdrainMods.RandomCreatedUser(f),
|
|
HistoryStormdrainMods.RandomGeometryX(f),
|
|
HistoryStormdrainMods.RandomGeometryY(f),
|
|
HistoryStormdrainMods.RandomLastEditedDate(f),
|
|
HistoryStormdrainMods.RandomLastEditedUser(f),
|
|
HistoryStormdrainMods.RandomVersion(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyStormdrainMods) OrganizationID(val int32) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.OrganizationID = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) OrganizationIDFunc(f func() int32) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.OrganizationID = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetOrganizationID() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomOrganizationID(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.OrganizationID = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyStormdrainMods) Creationdate(val null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) CreationdateFunc(f func() null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Creationdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetCreationdate() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreationdate(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreationdateNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) Creator(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Creator = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) CreatorFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Creator = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetCreator() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreator(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreatorNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) Editdate(val null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Editdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) EditdateFunc(f func() null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Editdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetEditdate() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomEditdate(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomEditdateNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) Editor(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Editor = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) EditorFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Editor = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetEditor() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomEditor(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomEditorNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) Globalid(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Globalid = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) GlobalidFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Globalid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetGlobalid() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomGlobalid(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomGlobalidNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) Jurisdiction(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Jurisdiction = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) JurisdictionFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Jurisdiction = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetJurisdiction() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Jurisdiction = 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 historyStormdrainMods) RandomJurisdiction(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Jurisdiction = 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 historyStormdrainMods) RandomJurisdictionNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Jurisdiction = 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 historyStormdrainMods) Lastaction(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lastaction = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) LastactionFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lastaction = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetLastaction() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lastaction = 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 historyStormdrainMods) RandomLastaction(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lastaction = 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 historyStormdrainMods) RandomLastactionNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lastaction = 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 historyStormdrainMods) Laststatus(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Laststatus = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) LaststatusFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Laststatus = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetLaststatus() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Laststatus = 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 historyStormdrainMods) RandomLaststatus(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Laststatus = 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 historyStormdrainMods) RandomLaststatusNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Laststatus = 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 historyStormdrainMods) Lasttreatdate(val null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lasttreatdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) LasttreatdateFunc(f func() null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lasttreatdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetLasttreatdate() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lasttreatdate = 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 historyStormdrainMods) RandomLasttreatdate(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lasttreatdate = 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 historyStormdrainMods) RandomLasttreatdateNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Lasttreatdate = 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 historyStormdrainMods) Nexttreatmentdate(val null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Nexttreatmentdate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) NexttreatmentdateFunc(f func() null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Nexttreatmentdate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetNexttreatmentdate() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Nexttreatmentdate = 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 historyStormdrainMods) RandomNexttreatmentdate(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Nexttreatmentdate = 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 historyStormdrainMods) RandomNexttreatmentdateNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Nexttreatmentdate = 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 historyStormdrainMods) Objectid(val int32) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Objectid = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) ObjectidFunc(f func() int32) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Objectid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetObjectid() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomObjectid(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Objectid = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m historyStormdrainMods) Symbology(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Symbology = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) SymbologyFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Symbology = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetSymbology() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Symbology = 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 historyStormdrainMods) RandomSymbology(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Symbology = 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 historyStormdrainMods) RandomSymbologyNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Symbology = 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 historyStormdrainMods) Type(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Type = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) TypeFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Type = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetType() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Type = 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 historyStormdrainMods) RandomType(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Type = 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 historyStormdrainMods) RandomTypeNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Type = 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 historyStormdrainMods) Zone(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) ZoneFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetZone() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone = 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 historyStormdrainMods) RandomZone(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone = 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 historyStormdrainMods) RandomZoneNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone = 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 historyStormdrainMods) Zone2(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone2 = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) Zone2Func(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone2 = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetZone2() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone2 = 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 historyStormdrainMods) RandomZone2(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone2 = 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 historyStormdrainMods) RandomZone2NotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Zone2 = 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 historyStormdrainMods) Created(val null.Val[time.Time]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Created = func() null.Val[time.Time] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) CreatedFunc(f func() null.Val[time.Time]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Created = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetCreated() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreated(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreatedNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) CreatedDate(val null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) CreatedDateFunc(f func() null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.CreatedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetCreatedDate() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreatedDate(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) CreatedUser(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) CreatedUserFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.CreatedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetCreatedUser() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreatedUser(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) GeometryX(val null.Val[float64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) GeometryXFunc(f func() null.Val[float64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.GeometryX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetGeometryX() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomGeometryX(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomGeometryXNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) GeometryY(val null.Val[float64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) GeometryYFunc(f func() null.Val[float64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.GeometryY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetGeometryY() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomGeometryY(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomGeometryYNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) LastEditedDate(val null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.LastEditedDate = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetLastEditedDate() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomLastEditedDate(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) LastEditedUser(val null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) LastEditedUserFunc(f func() null.Val[string]) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.LastEditedUser = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetLastEditedUser() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomLastEditedUser(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) Version(val int32) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Version = func() int32 { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m historyStormdrainMods) VersionFunc(f func() int32) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Version = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m historyStormdrainMods) UnsetVersion() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
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 historyStormdrainMods) RandomVersion(f *faker.Faker) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(_ context.Context, o *HistoryStormdrainTemplate) {
|
|
o.Version = func() int32 {
|
|
return random_int32(f)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyStormdrainMods) WithParentsCascading() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(ctx context.Context, o *HistoryStormdrainTemplate) {
|
|
if isDone, _ := historyStormdrainWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = historyStormdrainWithParentsCascadingCtx.WithValue(ctx, true)
|
|
{
|
|
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyStormdrainMods) WithOrganization(rel *OrganizationTemplate) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(ctx context.Context, o *HistoryStormdrainTemplate) {
|
|
o.r.Organization = &historyStormdrainROrganizationR{
|
|
o: rel,
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyStormdrainMods) WithNewOrganization(mods ...OrganizationMod) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(ctx context.Context, o *HistoryStormdrainTemplate) {
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
|
|
|
m.WithOrganization(related).Apply(ctx, o)
|
|
})
|
|
}
|
|
|
|
func (m historyStormdrainMods) WithExistingOrganization(em *models.Organization) HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(ctx context.Context, o *HistoryStormdrainTemplate) {
|
|
o.r.Organization = &historyStormdrainROrganizationR{
|
|
o: o.f.FromExistingOrganization(em),
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m historyStormdrainMods) WithoutOrganization() HistoryStormdrainMod {
|
|
return HistoryStormdrainModFunc(func(ctx context.Context, o *HistoryStormdrainTemplate) {
|
|
o.r.Organization = nil
|
|
})
|
|
}
|