diff --git a/config/database.go b/config/database.go index fdb82b038d..ff0d906395 100644 --- a/config/database.go +++ b/config/database.go @@ -153,7 +153,7 @@ func parseDSN(dsn string) (string, string, error) { // Strip off the mysql:// for the dsn with which to connect. dsn = s[1] - case "postgres": + case "postgres", "postgresql": // No changes required default: diff --git a/config/utils.go b/config/utils.go index cd8f05c1e4..3034db01ab 100644 --- a/config/utils.go +++ b/config/utils.go @@ -174,7 +174,9 @@ func Merge(cfg *model.Config, patch *model.Config, mergeConfig *utils.MergeConfi } func IsDatabaseDSN(dsn string) bool { - return strings.HasPrefix(dsn, "mysql://") || strings.HasPrefix(dsn, "postgres://") + return strings.HasPrefix(dsn, "mysql://") || + strings.HasPrefix(dsn, "postgres://") || + strings.HasPrefix(dsn, "postgresql://") } // stripPassword remove the password from a given DSN diff --git a/config/utils_test.go b/config/utils_test.go index 1754e174ac..4788fac807 100644 --- a/config/utils_test.go +++ b/config/utils_test.go @@ -159,10 +159,15 @@ func TestIsDatabaseDSN(t *testing.T) { Expected: true, }, { - Name: "Postgresql DSN", + Name: "Postgresql 'postgres' DSN", DSN: "postgres://localhost", Expected: true, }, + { + Name: "Postgresql 'postgresql' DSN", + DSN: "postgresql://localhost", + Expected: true, + }, { Name: "Empty DSN", DSN: "",