Fix for PostgreSQL DB creation using a database name, #3581

This commit is contained in:
Ylian Saint-Hilaire 2022-02-01 16:16:54 -08:00
parent b9b334e8a2
commit 39e1255ebe

1
db.js
View File

@ -680,6 +680,7 @@ module.exports.CreateDB = function (parent, func) {
// Postgres SQL
var connectinArgs = parent.args.postgres;
var dbname = (connectinArgs.database != null) ? connectinArgs.database : 'meshcentral';
delete connectinArgs.database;
obj.databaseType = 6;
const pgtools = require('pgtools');
pgtools.createdb(connectinArgs, dbname, function (err, res) {