Edit database.js
parent
8213729009
commit
6f4a41fbd7
|
@ -18,7 +18,7 @@ async function executeQuery(query, values = []) {
|
|||
return result.rows;
|
||||
}
|
||||
|
||||
async function InitializeDatabase() {
|
||||
async function Initialize() {
|
||||
console.log("Initializing database...")
|
||||
const sql = fs.readFileSync('database/init_database.sql').toString();
|
||||
await executeQuery(sql);
|
||||
|
@ -35,7 +35,13 @@ async function checkForDatabaseInitialization() {
|
|||
const scoresSchemaExists = result.length !== 0;
|
||||
|
||||
if(!scoresSchemaExists) {
|
||||
InitializeDatabase();
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
checkForDatabaseInitialization();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exports.executeQuery = executeQuery;
|
Reference in New Issue