1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

Add a tiny bit of extra logging to database connection

This commit is contained in:
TheArcaneBrony 2023-01-31 23:13:23 +01:00 committed by GitHub
parent 63b4a8997f
commit 1b6bc94afc

View File

@ -89,7 +89,7 @@ export async function initDatabase(): Promise<DataSource> {
}
}
console.log(`[Database] ${yellow(`connecting to ${DatabaseType} db`)}`);
console.log(`[Database] ${yellow(`Connecting to ${DatabaseType} db`)}`);
dbConnection = await DataSourceOptions.initialize();
@ -103,11 +103,10 @@ export async function initDatabase(): Promise<DataSource> {
}
};
if (!(await dbExists())) {
console.log(
"[Database] This appears to be a fresh database. Synchronising.",
);
console.log("[Database] This appears to be a fresh database. Synchronising.");
await dbConnection.synchronize();
} else {
console.log("[Database] Applying missing migrations, if any.");
await dbConnection.runMigrations();
}