fix: 解决数据库列表样式错乱的问题 (#2296)

This commit is contained in:
ssongliu 2023-09-14 22:50:13 +08:00 committed by GitHub
parent 21755223e1
commit 43b3ef47f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,7 @@ func Init() {
migrations.AddDatabases,
migrations.UpdateDatabase,
migrations.UpdateAppInstallResource,
migrations.DropDatabaseLocal,
})
if err := m.Migrate(); err != nil {
global.LOG.Error(err)

View File

@ -759,3 +759,11 @@ var UpdateAppInstallResource = &gormigrate.Migration{
return nil
},
}
var DropDatabaseLocal = &gormigrate.Migration{
ID: "20230914-drop-database-local",
Migrate: func(tx *gorm.DB) error {
_ = tx.Where("name = ? AND address = ?", "local", "127.0.0.1").Delete(&model.Database{}).Error
return nil
},
}