mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 04:32:35 +01:00
Rename postgresql to postgres -> fix silently failing migrations
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
This commit is contained in:
parent
f7c0317c8d
commit
a156c7bc62
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user