summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-31 23:33:07 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-31 23:33:07 +0100
commit352ad14e9af1b0a5ef065fac547a24fba32b6f32 (patch)
treef79172fad16976ba731b503ccb010e6eda11ca75 /src
parentHotfix postgres connection string to not silently fail migrations (diff)
downloadserver-352ad14e9af1b0a5ef065fac547a24fba32b6f32.tar.xz
Rename postgresql to postgres -> fix silently failing migrations
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/util/migration/postgres/1673609867556-templateDeleteCascade.ts (renamed from src/util/migration/postgresql/1673609867556-templateDeleteCascade.ts)0
-rw-r--r--src/util/migration/postgres/1675044825710-webauthn.ts (renamed from src/util/migration/postgresql/1675044825710-webauthn.ts)0
-rw-r--r--src/util/util/Database.ts6
3 files changed, 4 insertions, 2 deletions
diff --git a/src/util/migration/postgresql/1673609867556-templateDeleteCascade.ts b/src/util/migration/postgres/1673609867556-templateDeleteCascade.ts
index 41979e59..41979e59 100644
--- a/src/util/migration/postgresql/1673609867556-templateDeleteCascade.ts
+++ b/src/util/migration/postgres/1673609867556-templateDeleteCascade.ts
diff --git a/src/util/migration/postgresql/1675044825710-webauthn.ts b/src/util/migration/postgres/1675044825710-webauthn.ts
index ac43c928..ac43c928 100644
--- a/src/util/migration/postgresql/1675044825710-webauthn.ts
+++ b/src/util/migration/postgres/1675044825710-webauthn.ts
diff --git a/src/util/util/Database.ts b/src/util/util/Database.ts
index 31dfa710..492fb4e4 100644
--- a/src/util/util/Database.ts
+++ b/src/util/util/Database.ts
@@ -36,7 +36,7 @@ const dbConnectionString =
 	process.env.DATABASE || path.join(process.cwd(), "database.db");
 
 const DatabaseType = dbConnectionString.includes("://")
-	? dbConnectionString.split(":")[0]?.replace("+srv", "")?.replace("postgres", "postgresql")
+	? dbConnectionString.split(":")[0]?.replace("+srv", "")
 	: "sqlite";
 const isSqlite = DatabaseType.includes("sqlite");
 
@@ -103,7 +103,9 @@ 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.");