finish setup insert method, refactor sql migration file

This commit is contained in:
lbenedar
2026-04-17 17:33:21 +03:00
parent 1b7c7e9ae3
commit 21abe68858
47 changed files with 2054 additions and 1056 deletions

View File

@@ -8,14 +8,18 @@ type Media struct {
Caption string `json:"caption"`
}
func (m *Media) ToDB(dest *db.Media) bool {
func (m *Media) ToDB(dest **db.Media) bool {
if dest == nil {
return false
}
dest.Type = m.Type
dest.URL = m.URL
dest.Caption = m.Caption
media := &db.Media{
Type: m.Type,
URL: m.URL,
Caption: m.Caption,
}
*dest = media
return true
}