22 lines
370 B
Go
22 lines
370 B
Go
package initialize
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/pkg/errors"
|
|
"go.uber.org/zap"
|
|
"gorm.io/gorm"
|
|
"kra/internal/plugin/announcement/model"
|
|
)
|
|
|
|
func Gorm(ctx context.Context, db *gorm.DB) {
|
|
err := db.WithContext(ctx).AutoMigrate(
|
|
new(model.Info),
|
|
)
|
|
if err != nil {
|
|
err = errors.Wrap(err, "注册表失败!")
|
|
zap.L().Error(fmt.Sprintf("%+v", err))
|
|
}
|
|
}
|