Browse Source

fix: 解决不同 mysql 应用无法同名的问题 (#2252)

pull/2255/head
ssongliu 1 year ago committed by GitHub
parent
commit
9aaf3bf435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      backend/app/service/database_mysql.go

2
backend/app/service/database_mysql.go

@ -92,7 +92,7 @@ func (u *MysqlService) Create(ctx context.Context, req dto.MysqlDBCreate) (*mode
return nil, buserr.New(constant.ErrCmdIllegal) return nil, buserr.New(constant.ErrCmdIllegal)
} }
mysql, _ := mysqlRepo.Get(commonRepo.WithByName(req.Name), databaseRepo.WithByFrom(req.From)) mysql, _ := mysqlRepo.Get(commonRepo.WithByName(req.Name), mysqlRepo.WithByMysqlName(req.Database), databaseRepo.WithByFrom(req.From))
if mysql.ID != 0 { if mysql.ID != 0 {
return nil, constant.ErrRecordExist return nil, constant.ErrRecordExist
} }

Loading…
Cancel
Save