feat(db): add oauth_clients table for dynamic client registration
CI / build-and-test (push) Has been cancelled

* Introduced oauth_clients table with fields for client_id, client_name, redirect_uris, and created_at.
* Updated agent_persona_parts, agent_persona_skills, agent_persona_guardrails, agent_persona_traits, and arc_stage_parts tables to use unique constraints instead of primary keys for composite indexes.
This commit is contained in:
Hein
2026-05-07 13:30:30 +02:00
parent fb9606ef2b
commit a993859c62
21 changed files with 1223 additions and 5408 deletions
@@ -9,6 +9,7 @@ import (
type ModelPublicPersonaArc struct {
bun.BaseModel `bun:"table:public.persona_arc,alias:persona_arc"`
ID resolvespec_common.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
PersonaID int64 `bun:"persona_id,type:bigint,pk," json:"persona_id"`
ArcID int64 `bun:"arc_id,type:bigint,notnull," json:"arc_id"`
CurrentStageID int64 `bun:"current_stage_id,type:bigint,notnull," json:"current_stage_id"`
@@ -35,12 +36,12 @@ func (m ModelPublicPersonaArc) SchemaName() string {
// GetID returns the primary key value
func (m ModelPublicPersonaArc) GetID() int64 {
return int64(m.PersonaID)
return m.ID.Int64()
}
// GetIDStr returns the primary key as a string
func (m ModelPublicPersonaArc) GetIDStr() string {
return fmt.Sprintf("%d", m.PersonaID)
return fmt.Sprintf("%v", m.ID)
}
// SetID sets the primary key value
@@ -50,12 +51,12 @@ func (m ModelPublicPersonaArc) SetID(newid int64) {
// UpdateID updates the primary key value
func (m *ModelPublicPersonaArc) UpdateID(newid int64) {
m.PersonaID = newid
m.ID.FromString(fmt.Sprintf("%d", newid))
}
// GetIDName returns the name of the primary key column
func (m ModelPublicPersonaArc) GetIDName() string {
return "persona_id"
return "id"
}
// GetPrefix returns the table prefix