More activity stuff
Some checks failed
/ docker (push) Failing after 2m51s

This commit is contained in:
Melody Becker 2025-05-05 17:33:34 +02:00
parent 12c9e17c4b
commit dff031397e
14 changed files with 710 additions and 253 deletions

View file

@ -2,8 +2,8 @@ package models
// A list of all models stored in the database
var AllTypes = []any{
&Activity{},
&Collection{},
&ActivitystreamsActivity{},
&Emote{},
&Feed{},
&MediaMetadata{},

View file

@ -1,6 +1,6 @@
package models
type ActivitystreamsActivity struct {
type Activity struct {
Id string `gorm:"primarykey"`
Type string `gorm:"type:activitystreams_activity_type"`
ObjectId string

View file

@ -3,5 +3,5 @@ package models
type Collection struct {
Id string `gorm:"primarykey"`
TargetId string
TargetType uint32
TargetType string `orm:"type:collection_target_type"`
}

View file

@ -0,0 +1,28 @@
package models
import "database/sql/driver"
type CollectionTargetType string
const (
CollectionTargetUnknown = CollectionTargetType("unknown")
CollectionTargetPinnedNotes = CollectionTargetType("pinned")
CollectionTargetReactions = CollectionTargetType("reactions")
CollectionTargetBoostsAndQuotes = CollectionTargetType("boosts")
)
var AllCollectionTargetTypes = []CollectionTargetType{
CollectionTargetUnknown,
CollectionTargetPinnedNotes,
CollectionTargetReactions,
CollectionTargetBoostsAndQuotes,
}
func (n *CollectionTargetType) Value() (driver.Value, error) {
return n, nil
}
func (ct *CollectionTargetType) Scan(value any) error {
*ct = CollectionTargetType(value.(uint32))
return nil
}