From f812d9f7cd493620d18bf2830b539dd2a116f285 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:20:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=88=A0=E9=99=A4=20m?= =?UTF-8?q?ariadb=20=E7=9A=84=E6=97=B6=E5=80=99=E6=B2=A1=E6=9C=89=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#2219)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_utils.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index eac2c964e..d5c77aa9d 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -277,8 +277,9 @@ func deleteAppInstall(install model.AppInstall, deleteBackup bool, forceDelete b } func deleteLink(ctx context.Context, install *model.AppInstall, deleteDB bool, forceDelete bool) error { - if install.App.Key == "mysql" || install.App.Key == "mariadb" { + if DatabaseKeys[install.App.Key] { _ = databaseRepo.Delete(ctx, databaseRepo.WithAppInstallID(install.ID)) + _ = mysqlRepo.Delete(ctx, mysqlRepo.WithByMysqlName(install.Name)) } resources, _ := appInstallResourceRepo.GetBy(appInstallResourceRepo.WithAppInstallId(install.ID)) if len(resources) == 0 { @@ -286,7 +287,7 @@ func deleteLink(ctx context.Context, install *model.AppInstall, deleteDB bool, f } for _, re := range resources { mysqlService := NewIMysqlService() - if re.Key == "mysql" || re.Key == "mariadb" && deleteDB { + if (re.Key == "mysql" || re.Key == "mariadb") && deleteDB { database, _ := mysqlRepo.Get(commonRepo.WithByID(re.ResourceId)) if reflect.DeepEqual(database, model.DatabaseMysql{}) { continue