// Code generated by relspecgo. DO NOT EDIT. package generatedmodels import ( "fmt" resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/spectypes" "github.com/uptrace/bun" ) type ModelPublicAgentParts struct { bun.BaseModel `bun:"table:public.agent_parts,alias:agent_parts"` ID resolvespec_common.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"` Content resolvespec_common.SqlString `bun:"content,type:text,default:'',notnull," json:"content"` 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"` Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"` PartType resolvespec_common.SqlString `bun:"part_type,type:text,notnull," json:"part_type"` Summary resolvespec_common.SqlString `bun:"summary,type:text,notnull," json:"summary"` Tags resolvespec_common.SqlStringArray `bun:"tags,type:text[],default:'{}',notnull," json:"tags"` UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"` RelPartIDPublicAgentPersonaParts []*ModelPublicAgentPersonaParts `bun:"rel:has-many,join:id=part_id" json:"relpartidpublicagentpersonaparts,omitempty"` // Has many ModelPublicAgentPersonaParts RelPartIDPublicArcStageParts []*ModelPublicArcStageParts `bun:"rel:has-many,join:id=part_id" json:"relpartidpublicarcstageparts,omitempty"` // Has many ModelPublicArcStageParts } // TableName returns the table name for ModelPublicAgentParts func (m ModelPublicAgentParts) TableName() string { return "public.agent_parts" } // TableNameOnly returns the table name without schema for ModelPublicAgentParts func (m ModelPublicAgentParts) TableNameOnly() string { return "agent_parts" } // SchemaName returns the schema name for ModelPublicAgentParts func (m ModelPublicAgentParts) SchemaName() string { return "public" } // GetID returns the primary key value func (m ModelPublicAgentParts) GetID() int64 { return m.ID.Int64() } // GetIDStr returns the primary key as a string func (m ModelPublicAgentParts) GetIDStr() string { return fmt.Sprintf("%v", m.ID) } // SetID sets the primary key value func (m ModelPublicAgentParts) SetID(newid int64) { m.UpdateID(newid) } // UpdateID updates the primary key value func (m *ModelPublicAgentParts) UpdateID(newid int64) { m.ID.FromString(fmt.Sprintf("%d", newid)) } // GetIDName returns the name of the primary key column func (m ModelPublicAgentParts) GetIDName() string { return "id" } // GetPrefix returns the table prefix func (m ModelPublicAgentParts) GetPrefix() string { return "APG" }