* Introduce project_personas table with foreign keys to projects and agent_personas * Add project_skills table with foreign key to projects and agent_skills * Include override boolean field in agent_persona_skills and project_skills * Update schema and migration files to reflect new tables and fields * Enhance CORS handling to reflect request origin
This commit is contained in:
@@ -16,7 +16,7 @@ type ModelPublicAgentGuardrails struct {
|
||||
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"`
|
||||
Severity resolvespec_common.SqlString `bun:"severity,type:text,default:'medium',notnull," json:"severity"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
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"`
|
||||
RelGuardrailIDPublicAgentPersonaGuardrails []*ModelPublicAgentPersonaGuardrails `bun:"rel:has-many,join:id=guardrail_id" json:"relguardrailidpublicagentpersonaguardrails,omitempty"` // Has many ModelPublicAgentPersonaGuardrails
|
||||
RelGuardrailIDPublicPlanGuardrails []*ModelPublicPlanGuardrails `bun:"rel:has-many,join:id=guardrail_id" json:"relguardrailidpublicplanguardrails,omitempty"` // Has many ModelPublicPlanGuardrails
|
||||
@@ -45,7 +45,7 @@ func (m ModelPublicAgentGuardrails) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentGuardrails) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -17,7 +17,7 @@ type ModelPublicAgentParts struct {
|
||||
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"`
|
||||
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
|
||||
@@ -45,7 +45,7 @@ func (m ModelPublicAgentParts) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentParts) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -38,7 +38,7 @@ func (m ModelPublicAgentPersonaGuardrails) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentPersonaGuardrails) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -40,7 +40,7 @@ func (m ModelPublicAgentPersonaParts) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentPersonaParts) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
type ModelPublicAgentPersonaSkills struct {
|
||||
bun.BaseModel `bun:"table:public.agent_persona_skills,alias:agent_persona_skills"`
|
||||
ID resolvespec_common.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
|
||||
Override bool `bun:"override,type:boolean,default:false,notnull," json:"override"`
|
||||
PersonaID int64 `bun:"persona_id,type:bigint,notnull," json:"persona_id"`
|
||||
SkillID int64 `bun:"skill_id,type:bigint,notnull," json:"skill_id"`
|
||||
RelPersonaID *ModelPublicAgentPersonas `bun:"rel:has-one,join:persona_id=id" json:"relpersonaid,omitempty"` // Has one ModelPublicAgentPersonas
|
||||
@@ -38,7 +39,7 @@ func (m ModelPublicAgentPersonaSkills) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentPersonaSkills) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -38,7 +38,7 @@ func (m ModelPublicAgentPersonaTraits) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentPersonaTraits) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -19,10 +19,11 @@ type ModelPublicAgentPersonas struct {
|
||||
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"`
|
||||
Summary resolvespec_common.SqlString `bun:"summary,type:text,notnull," json:"summary"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
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"`
|
||||
RelPersonaIDPublicAgentPersonaParts []*ModelPublicAgentPersonaParts `bun:"rel:has-many,join:id=persona_id" json:"relpersonaidpublicagentpersonaparts,omitempty"` // Has many ModelPublicAgentPersonaParts
|
||||
RelPersonaIDPublicAgentPersonaSkills []*ModelPublicAgentPersonaSkills `bun:"rel:has-many,join:id=persona_id" json:"relpersonaidpublicagentpersonaskills,omitempty"` // Has many ModelPublicAgentPersonaSkills
|
||||
RelPersonaIDPublicProjectPersonas []*ModelPublicProjectPersonas `bun:"rel:has-many,join:id=persona_id" json:"relpersonaidpublicprojectpersonas,omitempty"` // Has many ModelPublicProjectPersonas
|
||||
RelPersonaIDPublicAgentPersonaGuardrails []*ModelPublicAgentPersonaGuardrails `bun:"rel:has-many,join:id=persona_id" json:"relpersonaidpublicagentpersonaguardrails,omitempty"` // Has many ModelPublicAgentPersonaGuardrails
|
||||
RelPersonaIDPublicAgentPersonaTraits []*ModelPublicAgentPersonaTraits `bun:"rel:has-many,join:id=persona_id" json:"relpersonaidpublicagentpersonatraits,omitempty"` // Has many ModelPublicAgentPersonaTraits
|
||||
RelPersonaIDPublicPersonaArcs []*ModelPublicPersonaArc `bun:"rel:has-many,join:id=persona_id" json:"relpersonaidpublicpersonaarcs,omitempty"` // Has many ModelPublicPersonaArc
|
||||
@@ -50,7 +51,7 @@ func (m ModelPublicAgentPersonas) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentPersonas) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -13,13 +13,13 @@ type ModelPublicAgentSkills struct {
|
||||
Content resolvespec_common.SqlString `bun:"content,type:text,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"`
|
||||
DomainTags resolvespec_common.SqlStringArray `bun:"domain_tags,type:text,default:'{}',notnull," json:"domain_tags"`
|
||||
FrameworkTags resolvespec_common.SqlStringArray `bun:"framework_tags,type:text,default:'{}',notnull," json:"framework_tags"`
|
||||
DomainTags resolvespec_common.SqlStringArray `bun:"domain_tags,type:text[],default:'{}',notnull," json:"domain_tags"`
|
||||
FrameworkTags resolvespec_common.SqlStringArray `bun:"framework_tags,type:text[],default:'{}',notnull," json:"framework_tags"`
|
||||
GUID resolvespec_common.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"`
|
||||
LanguageTags resolvespec_common.SqlStringArray `bun:"language_tags,type:text,default:'{}',notnull," json:"language_tags"`
|
||||
LibraryTags resolvespec_common.SqlStringArray `bun:"library_tags,type:text,default:'{}',notnull," json:"library_tags"`
|
||||
LanguageTags resolvespec_common.SqlStringArray `bun:"language_tags,type:text[],default:'{}',notnull," json:"language_tags"`
|
||||
LibraryTags resolvespec_common.SqlStringArray `bun:"library_tags,type:text[],default:'{}',notnull," json:"library_tags"`
|
||||
Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
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"`
|
||||
RelSkillIDPublicAgentPersonaSkills []*ModelPublicAgentPersonaSkills `bun:"rel:has-many,join:id=skill_id" json:"relskillidpublicagentpersonaskills,omitempty"` // Has many ModelPublicAgentPersonaSkills
|
||||
RelRelatedSkillIDPublicLearnings []*ModelPublicLearnings `bun:"rel:has-many,join:id=related_skill_id" json:"relrelatedskillidpubliclearnings,omitempty"` // Has many ModelPublicLearnings
|
||||
@@ -49,7 +49,7 @@ func (m ModelPublicAgentSkills) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentSkills) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -15,7 +15,7 @@ type ModelPublicAgentTraits struct {
|
||||
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"`
|
||||
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
|
||||
@@ -43,7 +43,7 @@ func (m ModelPublicAgentTraits) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicAgentTraits) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -38,7 +38,7 @@ func (m ModelPublicArcStageParts) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicArcStageParts) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -43,7 +43,7 @@ func (m ModelPublicArcStages) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicArcStages) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -41,7 +41,7 @@ func (m ModelPublicCharacterArcs) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicCharacterArcs) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -14,7 +14,7 @@ type ModelPublicChatHistories struct {
|
||||
Channel resolvespec_common.SqlString `bun:"channel,type:text,nullzero," json:"channel"`
|
||||
CreatedAt resolvespec_common.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
|
||||
GUID resolvespec_common.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"`
|
||||
Messages resolvespec_common.SqlJSONB `bun:"messages,type:jsonb,default:'',notnull," json:"messages"`
|
||||
Messages resolvespec_common.SqlJSONB `bun:"messages,type:jsonb,default:'[]',notnull," json:"messages"`
|
||||
Metadata resolvespec_common.SqlJSONB `bun:"metadata,type:jsonb,default:'{}',notnull," json:"metadata"`
|
||||
ProjectID resolvespec_common.SqlInt64 `bun:"project_id,type:bigint,nullzero," json:"project_id"`
|
||||
SessionID resolvespec_common.SqlString `bun:"session_id,type:text,notnull," json:"session_id"`
|
||||
@@ -46,7 +46,7 @@ func (m ModelPublicChatHistories) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicChatHistories) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -42,7 +42,7 @@ func (m ModelPublicEmbeddings) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicEmbeddings) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -29,7 +29,7 @@ type ModelPublicLearnings struct {
|
||||
Status resolvespec_common.SqlString `bun:"status,type:text,default:'pending',notnull," json:"status"`
|
||||
Summary resolvespec_common.SqlString `bun:"summary,type:text,notnull," json:"summary"`
|
||||
SupersedesLearningID resolvespec_common.SqlInt64 `bun:"supersedes_learning_id,type:bigint,nullzero," json:"supersedes_learning_id"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
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"`
|
||||
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
|
||||
@@ -60,7 +60,7 @@ func (m ModelPublicLearnings) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicLearnings) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -13,7 +13,7 @@ type ModelPublicOauthClients struct {
|
||||
ClientID resolvespec_common.SqlString `bun:"client_id,type:text,notnull," json:"client_id"`
|
||||
ClientName resolvespec_common.SqlString `bun:"client_name,type:text,default:'',notnull," json:"client_name"`
|
||||
CreatedAt resolvespec_common.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
|
||||
RedirectUris resolvespec_common.SqlStringArray `bun:"redirect_uris,type:text,default:'{}',notnull," json:"redirect_uris"`
|
||||
RedirectUris resolvespec_common.SqlStringArray `bun:"redirect_uris,type:text[],default:'{}',notnull," json:"redirect_uris"`
|
||||
}
|
||||
|
||||
// TableName returns the table name for ModelPublicOauthClients
|
||||
@@ -38,7 +38,7 @@ func (m ModelPublicOauthClients) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicOauthClients) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -41,7 +41,7 @@ func (m ModelPublicPersonaArc) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicPersonaArc) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -39,7 +39,7 @@ func (m ModelPublicPlanDependencies) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicPlanDependencies) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -39,7 +39,7 @@ func (m ModelPublicPlanGuardrails) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicPlanGuardrails) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -39,7 +39,7 @@ func (m ModelPublicPlanRelatedPlans) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicPlanRelatedPlans) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -39,7 +39,7 @@ func (m ModelPublicPlanSkills) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicPlanSkills) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -22,7 +22,7 @@ type ModelPublicPlans struct {
|
||||
ReviewedBy resolvespec_common.SqlString `bun:"reviewed_by,type:text,nullzero," json:"reviewed_by"`
|
||||
Status resolvespec_common.SqlString `bun:"status,type:text,default:'draft',notnull," json:"status"` // draft, active, blocked, completed, cancelled, superseded
|
||||
SupersedesPlanID resolvespec_common.SqlInt64 `bun:"supersedes_plan_id,type:bigint,nullzero," json:"supersedes_plan_id"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text[],default:'{}',notnull," json:"tags"`
|
||||
Title resolvespec_common.SqlString `bun:"title,type:text,notnull," json:"title"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=id" json:"relprojectid,omitempty"` // Has one ModelPublicProjects
|
||||
@@ -57,7 +57,7 @@ func (m ModelPublicPlans) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicPlans) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -39,7 +39,7 @@ func (m ModelPublicProjectGuardrails) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicProjectGuardrails) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// Code generated by relspecgo. DO NOT EDIT.
|
||||
package generatedmodels
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/spectypes"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type ModelPublicProjectPersonas struct {
|
||||
bun.BaseModel `bun:"table:public.project_personas,alias:project_personas"`
|
||||
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"`
|
||||
IsDefault bool `bun:"is_default,type:boolean,default:false,notnull," json:"is_default"`
|
||||
PersonaID int64 `bun:"persona_id,type:bigint,notnull," json:"persona_id"`
|
||||
ProjectID int64 `bun:"project_id,type:bigint,notnull," json:"project_id"`
|
||||
RelPersonaID *ModelPublicAgentPersonas `bun:"rel:has-one,join:persona_id=id" json:"relpersonaid,omitempty"` // Has one ModelPublicAgentPersonas
|
||||
RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=id" json:"relprojectid,omitempty"` // Has one ModelPublicProjects
|
||||
}
|
||||
|
||||
// TableName returns the table name for ModelPublicProjectPersonas
|
||||
func (m ModelPublicProjectPersonas) TableName() string {
|
||||
return "public.project_personas"
|
||||
}
|
||||
|
||||
// TableNameOnly returns the table name without schema for ModelPublicProjectPersonas
|
||||
func (m ModelPublicProjectPersonas) TableNameOnly() string {
|
||||
return "project_personas"
|
||||
}
|
||||
|
||||
// SchemaName returns the schema name for ModelPublicProjectPersonas
|
||||
func (m ModelPublicProjectPersonas) SchemaName() string {
|
||||
return "public"
|
||||
}
|
||||
|
||||
// GetID returns the primary key value
|
||||
func (m ModelPublicProjectPersonas) GetID() int64 {
|
||||
return m.ID.Int64()
|
||||
}
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicProjectPersonas) GetIDStr() string {
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
func (m ModelPublicProjectPersonas) SetID(newid int64) {
|
||||
m.UpdateID(newid)
|
||||
}
|
||||
|
||||
// UpdateID updates the primary key value
|
||||
func (m *ModelPublicProjectPersonas) UpdateID(newid int64) {
|
||||
m.ID.FromString(fmt.Sprintf("%d", newid))
|
||||
}
|
||||
|
||||
// GetIDName returns the name of the primary key column
|
||||
func (m ModelPublicProjectPersonas) GetIDName() string {
|
||||
return "id"
|
||||
}
|
||||
|
||||
// GetPrefix returns the table prefix
|
||||
func (m ModelPublicProjectPersonas) GetPrefix() string {
|
||||
return "PPR"
|
||||
}
|
||||
@@ -11,6 +11,7 @@ type ModelPublicProjectSkills struct {
|
||||
bun.BaseModel `bun:"table:public.project_skills,alias:project_skills"`
|
||||
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"`
|
||||
Override bool `bun:"override,type:boolean,default:false,notnull," json:"override"`
|
||||
ProjectID int64 `bun:"project_id,type:bigint,notnull," json:"project_id"`
|
||||
SkillID int64 `bun:"skill_id,type:bigint,notnull," json:"skill_id"`
|
||||
RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=id" json:"relprojectid,omitempty"` // Has one ModelPublicProjects
|
||||
@@ -39,7 +40,7 @@ func (m ModelPublicProjectSkills) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicProjectSkills) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -16,6 +16,7 @@ type ModelPublicProjects struct {
|
||||
LastActiveAt resolvespec_common.SqlTimeStamp `bun:"last_active_at,type:timestamptz,default:now(),nullzero," json:"last_active_at"`
|
||||
Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"`
|
||||
ThoughtCount resolvespec_common.SqlInt64 `bun:"thought_count,scanonly" json:"thought_count"`
|
||||
RelProjectIDPublicProjectPersonas []*ModelPublicProjectPersonas `bun:"rel:has-many,join:id=project_id" json:"relprojectidpublicprojectpersonas,omitempty"` // Has many ModelPublicProjectPersonas
|
||||
RelProjectIDPublicThoughts []*ModelPublicThoughts `bun:"rel:has-many,join:id=project_id" json:"relprojectidpublicthoughts,omitempty"` // Has many ModelPublicThoughts
|
||||
RelProjectIDPublicStoredFiles []*ModelPublicStoredFiles `bun:"rel:has-many,join:id=project_id" json:"relprojectidpublicstoredfiles,omitempty"` // Has many ModelPublicStoredFiles
|
||||
RelProjectIDPublicChatHistories []*ModelPublicChatHistories `bun:"rel:has-many,join:id=project_id" json:"relprojectidpublicchathistories,omitempty"` // Has many ModelPublicChatHistories
|
||||
@@ -47,7 +48,7 @@ func (m ModelPublicProjects) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicProjects) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -48,7 +48,7 @@ func (m ModelPublicStoredFiles) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicStoredFiles) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -40,7 +40,7 @@ func (m ModelPublicThoughtLinks) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicThoughtLinks) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -47,7 +47,7 @@ func (m ModelPublicThoughts) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicThoughts) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
@@ -38,7 +38,7 @@ func (m ModelPublicToolAnnotations) GetID() int64 {
|
||||
|
||||
// GetIDStr returns the primary key as a string
|
||||
func (m ModelPublicToolAnnotations) GetIDStr() string {
|
||||
return fmt.Sprintf("%v", m.ID)
|
||||
return m.ID.String()
|
||||
}
|
||||
|
||||
// SetID sets the primary key value
|
||||
|
||||
Reference in New Issue
Block a user