mirror of
https://gitlab.silvrtree.co.uk/martind2000/obrand-admin-server.git
synced 2025-01-10 20:55:07 +00:00
added db builder as a node file
This commit is contained in:
parent
65ca406f6b
commit
31151ab75a
20
dbconfig.js
20
dbconfig.js
@ -9,13 +9,6 @@ var db = require('./server/units/db-connector').dbConnection;
|
||||
var dbAccount = require('./server/units/db-accounts')(db);
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
function prepare_db() {
|
||||
exec('psql -Upostgres -d oBrand -h localhost -f ./obrand.sql', function(err) {
|
||||
if (err !== null) {
|
||||
console.log('exec error: ' + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addUsers() {
|
||||
'use strict';
|
||||
@ -40,5 +33,16 @@ function addUsers() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function prepare_db() {
|
||||
exec('psql -Upostgres -d oBrand -h localhost -f ./obrand.sql', function(err) {
|
||||
if (err !== null) {
|
||||
console.log('exec error: ' + err);
|
||||
} else {
|
||||
addUsers();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
prepare_db();
|
||||
addUsers();
|
||||
|
Loading…
Reference in New Issue
Block a user