67 lines
2.4 KiB
Go
67 lines
2.4 KiB
Go
// Code generated by relspecgo. DO NOT EDIT.
|
|
package models
|
|
|
|
import (
|
|
"fmt"
|
|
resolvespec_common "github.com/bitechdev/ResolveSpec/pkg/spectypes"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
type ModelPublicMessageCache struct {
|
|
bun.BaseModel `bun:"table:message_cache,alias:message_cache"`
|
|
ID resolvespec_common.SqlString `bun:"id,type:varchar(36),pk," json:"id"` // UUID
|
|
AccountID resolvespec_common.SqlString `bun:"account_id,type:varchar(36),notnull," json:"account_id"`
|
|
ChatID resolvespec_common.SqlString `bun:"chat_id,type:varchar(255),notnull," json:"chat_id"`
|
|
Content resolvespec_common.SqlString `bun:"content,type:text,notnull," json:"content"` // JSON encoded message content
|
|
CreatedAt resolvespec_common.SqlTime `bun:"created_at,type:timestamp,default:now(),notnull," json:"created_at"`
|
|
FromMe bool `bun:"from_me,type:boolean,notnull," json:"from_me"`
|
|
MessageID resolvespec_common.SqlString `bun:"message_id,type:varchar(255),notnull," json:"message_id"`
|
|
MessageType resolvespec_common.SqlString `bun:"message_type,type:varchar(50),notnull," json:"message_type"` // text
|
|
Timestamp resolvespec_common.SqlTime `bun:"timestamp,type:timestamp,notnull," json:"timestamp"`
|
|
}
|
|
|
|
// TableName returns the table name for ModelPublicMessageCache
|
|
func (m ModelPublicMessageCache) TableName() string {
|
|
return "message_cache"
|
|
}
|
|
|
|
// TableNameOnly returns the table name without schema for ModelPublicMessageCache
|
|
func (m ModelPublicMessageCache) TableNameOnly() string {
|
|
return "message_cache"
|
|
}
|
|
|
|
// SchemaName returns the schema name for ModelPublicMessageCache
|
|
func (m ModelPublicMessageCache) SchemaName() string {
|
|
return "public"
|
|
}
|
|
|
|
// GetID returns the primary key value
|
|
func (m ModelPublicMessageCache) GetID() int64 {
|
|
return m.ID.Int64()
|
|
}
|
|
|
|
// GetIDStr returns the primary key as a string
|
|
func (m ModelPublicMessageCache) GetIDStr() string {
|
|
return fmt.Sprintf("%d", m.ID)
|
|
}
|
|
|
|
// SetID sets the primary key value
|
|
func (m ModelPublicMessageCache) SetID(newid int64) {
|
|
m.UpdateID(newid)
|
|
}
|
|
|
|
// UpdateID updates the primary key value
|
|
func (m *ModelPublicMessageCache) UpdateID(newid int64) {
|
|
m.ID.FromString(fmt.Sprintf("%d", newid))
|
|
}
|
|
|
|
// GetIDName returns the name of the primary key column
|
|
func (m ModelPublicMessageCache) GetIDName() string {
|
|
return "id"
|
|
}
|
|
|
|
// GetPrefix returns the table prefix
|
|
func (m ModelPublicMessageCache) GetPrefix() string {
|
|
return "MCE"
|
|
}
|