Added PGSQL controller

This commit is contained in:
Martin Donnelly 2016-08-12 09:47:22 +01:00
parent 0d4d354855
commit cca339d245
3 changed files with 21794 additions and 0 deletions

38
dbconfig.js Normal file
View File

@ -0,0 +1,38 @@
/**
*
* User: Martin Donnelly
* Date: 2016-04-04
* Time: 14:46
*
*/
var exec = require('child_process').exec;
function prepare_db() {
exec('psql -Upostgres -d oBrand -h localhost -f ./mdot.sql', function(err) {
if (err !== null) {
console.log('exec error: ' + err);
return -1;
} else {
console.log('Done?');
}
});
}
function createDB() {
'use strict';
exec('createdb -Upostgres -h localhost mdot', function(err) {
if (err !== null) {
console.log('exec error: ' + err);
return -1;
} else {
prepare_db();
}
});
}
createDB();

21730
mdot.sql Normal file

File diff suppressed because it is too large Load Diff

26
pg_hba.conf Normal file
View File

@ -0,0 +1,26 @@
# Allow any user on the local system to connect to any database with
# any database user name using Unix-domain sockets (the default for local
# connections).
#
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
# The same using local loopback TCP/IP connections.
#
# TYPE DATABASE USER ADDRESS METHOD
host all all 127.0.0.1/32 trust
# The same as the previous line, but using a separate netmask column
#
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all 127.0.0.1 255.255.255.255 trust
# The same over IPv6.
#
# TYPE DATABASE USER ADDRESS METHOD
host all all ::1/128 trust
# The same using a host name (would typically cover both IPv4 and IPv6).
#
# TYPE DATABASE USER ADDRESS METHOD
host all all localhost trust