Skip to content

Commit

Permalink
fix data being overwriten
Browse files Browse the repository at this point in the history
  • Loading branch information
abs3ntdev committed Mar 24, 2023
1 parent 90ec8d8 commit 4bf51bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,10 @@ func findMigrationsForRenumber(path string) ([]string, error) {
}

func LoadConfig() (*Config, error) {
config := &Config{VersionTable: "public.schema_version"}
config := &Config{
VersionTable: "public.schema_version",
Data: make(map[string]interface{}),
}
if connConfig, err := pgx.ParseConfig(""); err == nil {
config.ConnConfig = *connConfig
} else {
Expand Down Expand Up @@ -1004,7 +1007,6 @@ func appendConfigFromFile(config *Config, path string) error {
config.SslRootCert = sslrootcert
}

config.Data = make(map[string]interface{})
for key, value := range file["data"] {
config.Data[key] = value
}
Expand Down

0 comments on commit 4bf51bc

Please sign in to comment.