mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
fix🐛 :修复初始化Duplicate column name 'is_frontend' (#376)
This commit is contained in:
@@ -3,6 +3,7 @@ package version
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
@@ -17,7 +18,7 @@ func _1615948084336Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
err := tx.Exec("alter table sys_config add is_frontend int default 1 null comment '是否前台参数' after config_type").Error
|
||||
if err != nil {
|
||||
if err != nil && !strings.Contains(err.Error(),"Duplicate column name 'is_frontend'") {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -25,4 +26,4 @@ func _1615948084336Test(db *gorm.DB, version string) error {
|
||||
Version: version,
|
||||
}).Error
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user