schema handling for postgres

This commit is contained in:
Helmut Merz 2024-03-24 14:19:01 +01:00
parent 1b83cd227f
commit 0202727990
2 changed files with 3 additions and 1 deletions

View file

@ -18,6 +18,7 @@ func ConfigPgsql() *sql.Cfg {
return &sql.Cfg{ return &sql.Cfg{
Driver: "postgres", Driver: "postgres",
Connstr: ovr("user=ccotest password=cco dbname=ccotest", PGSQL_CONNSTR), Connstr: ovr("user=ccotest password=cco dbname=ccotest", PGSQL_CONNSTR),
Schema: ovr("testing", PGSQL_SCHEMA),
} }
} }
@ -26,6 +27,7 @@ func ConfigPgsql() *sql.Cfg {
const ( const (
SQLITE_CONNSTR = "sqlite_connstr" SQLITE_CONNSTR = "sqlite_connstr"
PGSQL_CONNSTR = "pgsql_connstr" PGSQL_CONNSTR = "pgsql_connstr"
PGSQL_SCHEMA = "pgsql_schema"
) )
// in a production scenario this should be put in a separate // in a production scenario this should be put in a separate

View file

@ -80,7 +80,7 @@ func resetSqlite(db *sql.Storage) {
func resetPgsql(db *sql.Storage) { func resetPgsql(db *sql.Storage) {
db.DropTable("test") db.DropTable("test")
db.DropTable("tracks") db.DropTable("testing.tracks")
db.Exec(pgsql_create_table) db.Exec(pgsql_create_table)
} }