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
75 lines
3.2 KiB
Go
75 lines
3.2 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 ModelPublicStoredFiles struct {
|
|
bun.BaseModel `bun:"table:public.stored_files,alias:stored_files"`
|
|
ID sql_types.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
|
|
Content []byte `bun:"content,type:bytea,notnull," json:"content"`
|
|
CreatedAt sql_types.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
|
|
Encoding sql_types.SqlString `bun:"encoding,type:text,default:'base64',notnull," json:"encoding"`
|
|
GUID sql_types.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"`
|
|
Kind sql_types.SqlString `bun:"kind,type:text,default:'file',notnull," json:"kind"`
|
|
MediaType sql_types.SqlString `bun:"media_type,type:text,notnull," json:"media_type"`
|
|
Name sql_types.SqlString `bun:"name,type:text,notnull," json:"name"`
|
|
ProjectID sql_types.SqlInt64 `bun:"project_id,type:bigint,nullzero," json:"project_id"`
|
|
Sha256 sql_types.SqlString `bun:"sha256,type:text,notnull," json:"sha256"`
|
|
SizeBytes int64 `bun:"size_bytes,type:bigint,notnull," json:"size_bytes"`
|
|
TenantID sql_types.SqlString `bun:"tenant_id,type:text,nullzero," json:"tenant_id"`
|
|
ThoughtID sql_types.SqlInt64 `bun:"thought_id,type:bigint,nullzero," json:"thought_id"`
|
|
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
|
|
RelThoughtID *ModelPublicThoughts `bun:"rel:has-one,join:thought_id=id" json:"relthoughtid,omitempty"` // Has one ModelPublicThoughts
|
|
}
|
|
|
|
// TableName returns the table name for ModelPublicStoredFiles
|
|
func (m ModelPublicStoredFiles) TableName() string {
|
|
return "public.stored_files"
|
|
}
|
|
|
|
// TableNameOnly returns the table name without schema for ModelPublicStoredFiles
|
|
func (m ModelPublicStoredFiles) TableNameOnly() string {
|
|
return "stored_files"
|
|
}
|
|
|
|
// SchemaName returns the schema name for ModelPublicStoredFiles
|
|
func (m ModelPublicStoredFiles) SchemaName() string {
|
|
return "public"
|
|
}
|
|
|
|
// GetID returns the primary key value
|
|
func (m ModelPublicStoredFiles) GetID() int64 {
|
|
return m.ID.Int64()
|
|
}
|
|
|
|
// GetIDStr returns the primary key as a string
|
|
func (m ModelPublicStoredFiles) GetIDStr() string {
|
|
return m.ID.String()
|
|
}
|
|
|
|
// SetID sets the primary key value
|
|
func (m ModelPublicStoredFiles) SetID(newid int64) {
|
|
m.UpdateID(newid)
|
|
}
|
|
|
|
// UpdateID updates the primary key value
|
|
func (m *ModelPublicStoredFiles) UpdateID(newid int64) {
|
|
m.ID.FromString(fmt.Sprintf("%d", newid))
|
|
}
|
|
|
|
// GetIDName returns the name of the primary key column
|
|
func (m ModelPublicStoredFiles) GetIDName() string {
|
|
return "id"
|
|
}
|
|
|
|
// GetPrefix returns the table prefix
|
|
func (m ModelPublicStoredFiles) GetPrefix() string {
|
|
return "SFT"
|
|
}
|