feat: add user model

This commit is contained in:
Noah Hsu
2022-06-16 16:06:10 +08:00
parent 1df5472855
commit 56c95eadea
3 changed files with 109 additions and 3 deletions

View File

@ -3,11 +3,15 @@ package store
import (
"github.com/alist-org/alist/v3/internal/model"
"gorm.io/gorm"
"log"
)
var db gorm.DB
func Init(dbgorm *gorm.DB) {
db = *dbgorm
db.AutoMigrate(&model.Account{})
func Init(d *gorm.DB) {
db = *d
err := db.AutoMigrate(&model.Account{})
if err != nil {
log.Fatalf("failed migrate database: %s", err.Error())
}
}