finish setup insert method, refactor sql migration file
This commit is contained in:
@@ -10,16 +10,20 @@ type Index struct {
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
func (i *Index) ToDB(dest *db.Index) bool {
|
||||
func (i *Index) ToDB(dest **db.Index) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dest.ID = i.Id
|
||||
dest.Folder = i.Folder
|
||||
dest.Img = i.Img
|
||||
dest.Name = i.Name
|
||||
dest.Type = i.Type
|
||||
index := &db.Index{
|
||||
ID: i.Id,
|
||||
Folder: i.Folder,
|
||||
Img: i.Img,
|
||||
Name: i.Name,
|
||||
Type: i.Type,
|
||||
}
|
||||
|
||||
*dest = index
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user