package initialize

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"github.com/flipped-aurora/gin-vue-admin/server/model/book"
)

func bizModel() error {
	db := global.GVA_DB
	err := db.AutoMigrate(
		&book.Book{},
		&book.BookAuthor{},
		&book.BookAuthorRelation{},
		&book.BookChapter{},
		&book.BookComment{},
		&book.BookCommentLikeRecord{},
		&book.BookFavoriteRecord{},
		&book.BookReadRecord{},
		&book.BookSeries{},
	)
	if err != nil {
		return err
	}
	return nil
}
