mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-09 19:20:56 +08:00
feat: Application installation supports existing remote databases (#9531)
This commit is contained in:
parent
7bf1bf61a7
commit
700076f278
1 changed files with 3 additions and 0 deletions
|
|
@ -256,6 +256,9 @@ func createLink(ctx context.Context, installTask *task.Task, app model.App, appI
|
|||
switch database.Type {
|
||||
case constant.AppPostgresql, constant.AppPostgres, constant.AppPostgresqlCluster:
|
||||
oldPostgresqlDb, _ := postgresqlRepo.Get(repo.WithByName(dbConfig.DbName), repo.WithByFrom(constant.ResourceLocal))
|
||||
if oldPostgresqlDb.ID == 0 {
|
||||
oldPostgresqlDb, _ = postgresqlRepo.Get(repo.WithByName(dbConfig.DbName), repo.WithByFrom(constant.AppResourceRemote))
|
||||
}
|
||||
resourceId = oldPostgresqlDb.ID
|
||||
if oldPostgresqlDb.ID > 0 {
|
||||
if oldPostgresqlDb.Username != dbConfig.DbUser || oldPostgresqlDb.Password != dbConfig.Password {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue