// Code generated by relspecgo. DO NOT EDIT. package generatedmodels import ( "fmt" sql_types "git.warky.dev/wdevs/relspecgo/pkg/sqltypes" "github.com/uptrace/bun" ) type ModelPublicLearnings struct { bun.BaseModel `bun:"table:public.learnings,alias:learnings"` ID sql_types.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"` ActionRequired bool `bun:"action_required,type:boolean,default:false,notnull," json:"action_required"` Area sql_types.SqlString `bun:"area,type:text,default:'other',notnull," json:"area"` Category sql_types.SqlString `bun:"category,type:text,default:'insight',notnull," json:"category"` Confidence sql_types.SqlString `bun:"confidence,type:text,default:'hypothesis',notnull," json:"confidence"` CreatedAt sql_types.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"` Details sql_types.SqlString `bun:"details,type:text,default:'',notnull," json:"details"` DuplicateOfLearningID sql_types.SqlInt64 `bun:"duplicate_of_learning_id,type:bigint,nullzero," json:"duplicate_of_learning_id"` GUID sql_types.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"` Priority sql_types.SqlString `bun:"priority,type:text,default:'medium',notnull," json:"priority"` ProjectID sql_types.SqlInt64 `bun:"project_id,type:bigint,nullzero," json:"project_id"` RelatedSkillID sql_types.SqlInt64 `bun:"related_skill_id,type:bigint,nullzero," json:"related_skill_id"` RelatedThoughtID sql_types.SqlInt64 `bun:"related_thought_id,type:bigint,nullzero," json:"related_thought_id"` ReviewedAt sql_types.SqlTimeStamp `bun:"reviewed_at,type:timestamptz,nullzero," json:"reviewed_at"` ReviewedBy sql_types.SqlString `bun:"reviewed_by,type:text,nullzero," json:"reviewed_by"` SourceRef sql_types.SqlString `bun:"source_ref,type:text,nullzero," json:"source_ref"` SourceType sql_types.SqlString `bun:"source_type,type:text,nullzero," json:"source_type"` Status sql_types.SqlString `bun:"status,type:text,default:'pending',notnull," json:"status"` Summary sql_types.SqlString `bun:"summary,type:text,notnull," json:"summary"` SupersedesLearningID sql_types.SqlInt64 `bun:"supersedes_learning_id,type:bigint,nullzero," json:"supersedes_learning_id"` Tags sql_types.SqlStringArray `bun:"tags,type:text[],default:'{}',notnull," json:"tags"` TenantKey sql_types.SqlString `bun:"tenant_key,type:text,nullzero," json:"tenant_key"` UpdatedAt sql_types.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"` RelDuplicateOfLearningID *ModelPublicLearnings `bun:"rel:has-one,join:duplicate_of_learning_id=id" json:"relduplicateoflearningid,omitempty"` // Has one ModelPublicLearnings RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=id" json:"relprojectid,omitempty"` // Has one ModelPublicProjects RelRelatedSkillID *ModelPublicAgentSkills `bun:"rel:has-one,join:related_skill_id=id" json:"relrelatedskillid,omitempty"` // Has one ModelPublicAgentSkills RelRelatedThoughtID *ModelPublicThoughts `bun:"rel:has-one,join:related_thought_id=id" json:"relrelatedthoughtid,omitempty"` // Has one ModelPublicThoughts RelSupersedesLearningID *ModelPublicLearnings `bun:"rel:has-one,join:supersedes_learning_id=id" json:"relsupersedeslearningid,omitempty"` // Has one ModelPublicLearnings RelLearningIDPublicThoughtLearningLinks []*ModelPublicThoughtLearningLinks `bun:"rel:has-many,join:id=learning_id" json:"rellearningidpublicthoughtlearninglinks,omitempty"` // Has many ModelPublicThoughtLearningLinks } // TableName returns the table name for ModelPublicLearnings func (m ModelPublicLearnings) TableName() string { return "public.learnings" } // TableNameOnly returns the table name without schema for ModelPublicLearnings func (m ModelPublicLearnings) TableNameOnly() string { return "learnings" } // SchemaName returns the schema name for ModelPublicLearnings func (m ModelPublicLearnings) SchemaName() string { return "public" } // GetID returns the primary key value func (m ModelPublicLearnings) GetID() int64 { return m.ID.Int64() } // GetIDStr returns the primary key as a string func (m ModelPublicLearnings) GetIDStr() string { return m.ID.String() } // SetID sets the primary key value func (m ModelPublicLearnings) SetID(newid int64) { m.UpdateID(newid) } // UpdateID updates the primary key value func (m *ModelPublicLearnings) UpdateID(newid int64) { m.ID.FromString(fmt.Sprintf("%d", newid)) } // GetIDName returns the name of the primary key column func (m ModelPublicLearnings) GetIDName() string { return "id" } // GetPrefix returns the table prefix func (m ModelPublicLearnings) GetPrefix() string { return "LEA" }