feat: initial setting items

This commit is contained in:
Noah Hsu
2022-06-27 15:51:02 +08:00
parent e4c3ef0262
commit 1a148eee7c
11 changed files with 136 additions and 17 deletions

17
internal/db/db.go Normal file
View File

@ -0,0 +1,17 @@
package db
import (
"github.com/alist-org/alist/v3/internal/model"
"gorm.io/gorm"
"log"
)
var db gorm.DB
func Init(d *gorm.DB) {
db = *d
err := db.AutoMigrate(new(model.Account), new(model.User), new(model.Meta), new(model.SettingItem))
if err != nil {
log.Fatalf("failed migrate database: %s", err.Error())
}
}