fix: backups should be done with internal db url

fix: create default database on mongodb start with a collection
This commit is contained in:
Andras Bacsai
2023-10-24 09:34:35 +02:00
parent b539f40fa5
commit 91acd4cb6a
7 changed files with 34 additions and 11 deletions

View File

@@ -62,9 +62,9 @@ class StandalonePostgresql extends BaseModel
{
return 'standalone-postgresql';
}
public function getDbUrl(): string
public function getDbUrl(bool $useInternal = false): string
{
if ($this->is_public) {
if ($this->is_public && !$useInternal) {
return "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->destination->server->getIp}:{$this->public_port}/{$this->postgres_db}";
} else {
return "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->uuid}:5432/{$this->postgres_db}";