migrate ✅ 优化migrate
This commit is contained in:
1 parent
e40047a88e
commit
1a111f0666
49 files changed
+677
-202
No files matched your search
@@ -1,10 +1,11 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
@@ -18,7 +19,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 && !strings.Contains(err.Error(),"Duplicate column name 'is_frontend'") {
|
||||
if err != nil && !strings.Contains(err.Error(), "Duplicate column name 'is_frontend'") {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -26,4 +27,4 @@ func _1615948084336Test(db *gorm.DB, version string) error {
|
||||
Version: version,
|
||||
}).Error
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user