// Code generated by relspecgo. DO NOT EDIT. package generatedmodels import ( "fmt" resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/spectypes" "github.com/uptrace/bun" ) type ModelPublicAgentTraits struct { bun.BaseModel `bun:"table:public.agent_traits,alias:agent_traits"` ID resolvespec_common.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"` CreatedAt resolvespec_common.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"` Description resolvespec_common.SqlString `bun:"description,type:text,default:'',notnull," json:"description"` GUID resolvespec_common.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"` Instruction resolvespec_common.SqlString `bun:"instruction,type:text,default:'',notnull," json:"instruction"` Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"` Tags resolvespec_common.SqlStringArray `bun:"tags,type:text[],default:'{}',notnull," json:"tags"` TraitType resolvespec_common.SqlString `bun:"trait_type,type:text,notnull," json:"trait_type"` UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"` RelTraitIDPublicAgentPersonaTraits []*ModelPublicAgentPersonaTraits `bun:"rel:has-many,join:id=trait_id" json:"reltraitidpublicagentpersonatraits,omitempty"` // Has many ModelPublicAgentPersonaTraits } // TableName returns the table name for ModelPublicAgentTraits func (m ModelPublicAgentTraits) TableName() string { return "public.agent_traits" } // TableNameOnly returns the table name without schema for ModelPublicAgentTraits func (m ModelPublicAgentTraits) TableNameOnly() string { return "agent_traits" } // SchemaName returns the schema name for ModelPublicAgentTraits func (m ModelPublicAgentTraits) SchemaName() string { return "public" } // GetID returns the primary key value func (m ModelPublicAgentTraits) GetID() int64 { return m.ID.Int64() } // GetIDStr returns the primary key as a string func (m ModelPublicAgentTraits) GetIDStr() string { return fmt.Sprintf("%v", m.ID) } // SetID sets the primary key value func (m ModelPublicAgentTraits) SetID(newid int64) { m.UpdateID(newid) } // UpdateID updates the primary key value func (m *ModelPublicAgentTraits) UpdateID(newid int64) { m.ID.FromString(fmt.Sprintf("%d", newid)) } // GetIDName returns the name of the primary key column func (m ModelPublicAgentTraits) GetIDName() string { return "id" } // GetPrefix returns the table prefix func (m ModelPublicAgentTraits) GetPrefix() string { return "ATG" }