Skip to content

Commit

Permalink
Use doctrine.dbal.connections.default.server_version in addition to d…
Browse files Browse the repository at this point in the history
…octrine.dbal.server_version
  • Loading branch information
fabpot committed Feb 9, 2024
1 parent 1f88541 commit 55e40ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions local/platformsh/db_versions.go
Expand Up @@ -85,13 +85,23 @@ func ReadDBVersionFromDoctrineConfigYAML(projectDir string) (string, error) {
Doctrine struct {
Dbal struct {
ServerVersion string `yaml:"server_version"`
Connections struct {
Default struct {
ServerVersion string `yaml:"server_version"`
} `yaml:"default"`
}
} `yaml:"dbal"`
} `yaml:"doctrine"`
}
if err := yaml.Unmarshal(doctrineConfigYAML, &doctrineConfig); err != nil {
// format is wrong
return "", err
}

if doctrineConfig.Doctrine.Dbal.Connections.Default.ServerVersion != "" {
return doctrineConfig.Doctrine.Dbal.Connections.Default.ServerVersion, nil
}

return doctrineConfig.Doctrine.Dbal.ServerVersion, nil
}

Expand Down

0 comments on commit 55e40ab

Please sign in to comment.