Skip to content

Commit

Permalink
Fix assignment of TARGET_DATABASE_URI
Browse files Browse the repository at this point in the history
  • Loading branch information
jsierles committed Dec 5, 2023
1 parent 213fd41 commit fb21463
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/migrate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func main() {
var targetURI string
operatorPass := os.Getenv("OPERATOR_PASSWORD")
appName := os.Getenv("FLY_APP_NAME")
targetURI = os.Getenv("TARGET_DATABASE_URI")

if appName != "" {
targetURI = fmt.Sprintf("postgres://postgres:%s@%s.internal:5432", operatorPass, appName)
Expand All @@ -54,8 +55,6 @@ func main() {
}
}

targetURI = os.Getenv("TARGET_DATABASE_URI")

if targetURI == "" {
log.Println("[error] FLY_APP_NAME or TARGET_DATABASE_URI environment variable must be set")
os.Exit(1)
Expand Down

0 comments on commit fb21463

Please # to comment.