From 49d217e990ecc6a411c0251910e92d9672de07ff Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:54:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=88=87=E6=8D=A2=E5=AF=BC=E8=87=B4=E7=9A=84=E9=94=99?= =?UTF-8?q?=E4=B9=B1=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98=20(#2259)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/init/migration/migrations/init.go | 16 +++++++++------- frontend/src/views/database/mysql/index.vue | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go index 2b6282da3..f4b86a38f 100644 --- a/backend/init/migration/migrations/init.go +++ b/backend/init/migration/migrations/init.go @@ -576,13 +576,15 @@ var AddDatabases = &gormigrate.Migration{ _ = tx.Where("name = ?", mysqlInfo.Name).First(&mysqlDb).Error if mysqlDb.ID == 0 { if err := tx.Create(&model.Database{ - Name: mysqlDb.Name, - Type: "mysql", - Version: mysqlInfo.Version, - From: "local", - Address: mysqlInfo.ServiceName, - Username: "root", - Password: mysqlInfo.Password, + AppInstallID: mysqlInfo.ID, + Name: mysqlInfo.Name, + Type: "mysql", + Version: mysqlInfo.Version, + From: "local", + Address: mysqlInfo.ServiceName, + Port: uint(mysqlInfo.Port), + Username: "root", + Password: mysqlInfo.Password, }).Error; err != nil { return err } diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue index 6dcfe722c..3c09b456b 100644 --- a/frontend/src/views/database/mysql/index.vue +++ b/frontend/src/views/database/mysql/index.vue @@ -164,7 +164,7 @@ -