Files
yatm/library/library.go
Samuel N Cui f87ec06af6 feat: useable
2022-12-12 22:48:28 +08:00

22 lines
276 B
Go

package library
import (
"gorm.io/gorm"
)
const (
batchSize = 100
)
type Library struct {
db *gorm.DB
}
func New(db *gorm.DB) *Library {
return &Library{db: db}
}
func (l *Library) AutoMigrate() error {
return l.db.AutoMigrate(ModelFile, ModelPosition, ModelTape)
}