add new models, change migration files, prepare to add all new tables from models

This commit is contained in:
lbenedar
2026-04-15 17:01:30 +03:00
parent 5bb592ea8a
commit 69d3d38ab7
95 changed files with 5371 additions and 12 deletions

View File

@@ -0,0 +1,40 @@
package json
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/temp_models/db"
type Macro struct {
Command string `json:"command"`
Name string `json:"name"`
Type string `json:"type"`
Img string `json:"img"`
ID string `json:"_id"`
Author string `json:"author"`
Scope string `json:"scope"`
Folder string `json:"folder"`
Sort int `json:"sort"`
Ownership map[string]int `json:"ownership,omitempty"`
Stats Stats `json:"_stats"`
// Flags any `json:"flags,omitempty"`
}
func (m *Macro) ToDB(dest *db.Macro) bool {
if dest == nil {
return false
}
dest.Command = m.Command
dest.Name = m.Name
dest.Type = m.Type
dest.Img = m.Img
dest.ID = m.ID
dest.Author = m.Author
dest.Scope = m.Scope
dest.Folder = m.Folder
dest.Sort = m.Sort
m.Stats.ToDB(&dest.Stats)
OwnershipToDB(&dest.Ownership, m.Ownership)
return true
}