Browse Source

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

pull/2305/head
ssongliu 1 year ago committed by GitHub
parent
commit
43b3ef47f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      backend/init/migration/migrate.go
  2. 8
      backend/init/migration/migrations/init.go

1
backend/init/migration/migrate.go

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

8
backend/init/migration/migrations/init.go

@ -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
},
}

Loading…
Cancel
Save