196b543bee
CI / build-and-test (push) Successful in 1m47s
* Implement tenant and user creation in IdentityPage * Add API calls for managing tenants and users * Introduce tenant-scoped API requests * Update sidebar to include identity navigation * Create BooleanStatusBadge component for key status
73 lines
3.0 KiB
Go
73 lines
3.0 KiB
Go
// 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 ModelPublicChatHistories struct {
|
|
bun.BaseModel `bun:"table:public.chat_histories,alias:chat_histories"`
|
|
ID sql_types.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
|
|
AgentID sql_types.SqlString `bun:"agent_id,type:text,nullzero," json:"agent_id"`
|
|
Channel sql_types.SqlString `bun:"channel,type:text,nullzero," json:"channel"`
|
|
CreatedAt sql_types.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
|
|
GUID sql_types.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"`
|
|
Messages sql_types.SqlJSONB `bun:"messages,type:jsonb,default:'[]',notnull," json:"messages"`
|
|
Metadata sql_types.SqlJSONB `bun:"metadata,type:jsonb,default:'{}',notnull," json:"metadata"`
|
|
ProjectID sql_types.SqlInt64 `bun:"project_id,type:bigint,nullzero," json:"project_id"`
|
|
SessionID sql_types.SqlString `bun:"session_id,type:text,notnull," json:"session_id"`
|
|
Summary sql_types.SqlString `bun:"summary,type:text,nullzero," json:"summary"`
|
|
TenantID sql_types.SqlString `bun:"tenant_id,type:text,nullzero," json:"tenant_id"`
|
|
Title sql_types.SqlString `bun:"title,type:text,nullzero," json:"title"`
|
|
UpdatedAt sql_types.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
|
|
RelTenantID *ModelPublicTenants `bun:"rel:has-one,join:tenant_id=id" json:"reltenantid,omitempty"` // Has one ModelPublicTenants
|
|
}
|
|
|
|
// TableName returns the table name for ModelPublicChatHistories
|
|
func (m ModelPublicChatHistories) TableName() string {
|
|
return "public.chat_histories"
|
|
}
|
|
|
|
// TableNameOnly returns the table name without schema for ModelPublicChatHistories
|
|
func (m ModelPublicChatHistories) TableNameOnly() string {
|
|
return "chat_histories"
|
|
}
|
|
|
|
// SchemaName returns the schema name for ModelPublicChatHistories
|
|
func (m ModelPublicChatHistories) SchemaName() string {
|
|
return "public"
|
|
}
|
|
|
|
// GetID returns the primary key value
|
|
func (m ModelPublicChatHistories) GetID() int64 {
|
|
return m.ID.Int64()
|
|
}
|
|
|
|
// GetIDStr returns the primary key as a string
|
|
func (m ModelPublicChatHistories) GetIDStr() string {
|
|
return m.ID.String()
|
|
}
|
|
|
|
// SetID sets the primary key value
|
|
func (m ModelPublicChatHistories) SetID(newid int64) {
|
|
m.UpdateID(newid)
|
|
}
|
|
|
|
// UpdateID updates the primary key value
|
|
func (m *ModelPublicChatHistories) UpdateID(newid int64) {
|
|
m.ID.FromString(fmt.Sprintf("%d", newid))
|
|
}
|
|
|
|
// GetIDName returns the name of the primary key column
|
|
func (m ModelPublicChatHistories) GetIDName() string {
|
|
return "id"
|
|
}
|
|
|
|
// GetPrefix returns the table prefix
|
|
func (m ModelPublicChatHistories) GetPrefix() string {
|
|
return "CHH"
|
|
}
|