feat: allow setting schema for connection in postgres (#2777)

This PR introduce a new config for database, `database.schema`, allowing user to specify a specific schema to use for their postgres database connection. As the default value is set, it will be backward compatible.

Related discussion: https://community.vikunja.io/t/postgres-database-has-error-pq-relation-tasks-does-not-exist/1333

Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2777
Co-authored-by: John Doe <hugosum.dev@protonmail.com>
Co-committed-by: John Doe <hugosum.dev@protonmail.com>
This commit is contained in:
John Doe
2024-10-26 16:06:47 +00:00
committed by konrad
parent b5cbe99b0a
commit 28d5cd7b28
2 changed files with 3 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ const (
DatabaseSslKey Key = `database.sslkey`
DatabaseSslRootCert Key = `database.sslrootcert`
DatabaseTLS Key = `database.tls`
DatabaseSchema Key = `database.schema`
TypesenseEnabled Key = `typesense.enabled`
TypesenseURL Key = `typesense.url`
@@ -344,6 +345,7 @@ func InitDefaultConfig() {
DatabaseSslKey.setDefault("")
DatabaseSslRootCert.setDefault("")
DatabaseTLS.setDefault("false")
DatabaseSchema.setDefault("public")
// Typesense
TypesenseEnabled.setDefault(false)