throw error if migrate failed

This commit is contained in:
kaiyuan committed 2022-04-08 10:32:07 +08:00
1 parent bf93b86bd0
commit eb33515e29
2 files changed
+11 -6

No files matched your search

@@ -3,11 +3,11 @@ package version
import (
"runtime"
"gorm.io/gorm"
"go-admin/cmd/migrate/migration"
"go-admin/cmd/migrate/migration/models"
common "go-admin/common/models"
"gorm.io/gorm"
)
func init() {
@@ -41,7 +41,7 @@ func _1599190683659Tables(db *gorm.DB, version string) error {
return err
}
if err := models.InitDb(tx); err != nil {
return err
}
return tx.Create(&common.Migration{
Version: version,