diff --git a/storage/postgresql.go b/storage/postgresql.go index 77e8042..968be12 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -18,6 +18,7 @@ import ( type PostgresqlStorage struct { DbConnection *sql.DB + Schema string Tables map[string]string } @@ -47,6 +48,7 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { } return PostgresqlStorage{ DbConnection: db, + Schema: pg_schema, Tables: map[string]string{ "accounts": fmt.Sprintf("%s.%s", pg_schema, pgtables_accounts), "accounts_auth_local": fmt.Sprintf("%s.%s", pg_schema, pgtables_accounts_auth_local), @@ -426,7 +428,7 @@ func (psql PostgresqlStorage) Migrate() error { return err } - existing, err := driver.InspectRealm(ctx, nil) + existing, err := driver.InspectRealm(ctx, &schema.InspectRealmOption{Schemas: []string{psql.Schema}}) if err != nil { return err }