mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-28 12:00:01 +02:00
Add support for database schema in PostgreSQL (#8819)
* Add support for database schema * Require setting search_path for the db user * Add schema setting to admin/config.tmpl * Use a schema different from default for psql tests * Update postgres scripts to use custom schema * Update to xorm/core 0.7.3 and xorm/xorm c37aff9b3a * Fix migration test Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
6d6f1d568e
commit
ad1b6d439f
28 changed files with 177 additions and 407 deletions
|
@ -128,7 +128,12 @@ func getEngine() (*xorm.Engine, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return xorm.NewEngine(setting.Database.Type, connStr)
|
||||
engine, err := xorm.NewEngine(setting.Database.Type, connStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
engine.SetSchema(setting.Database.Schema)
|
||||
return engine, nil
|
||||
}
|
||||
|
||||
// NewTestEngine sets a new test xorm.Engine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue