From a4f567af0fd0b35f53a1b6f9be75ad17bd6d3c68 Mon Sep 17 00:00:00 2001 From: Montmorency Date: Mon, 9 Oct 2023 20:53:53 +0100 Subject: [PATCH] Database url not relative to current dir. --- IHP/Test/Database.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IHP/Test/Database.hs b/IHP/Test/Database.hs index a7dad9ce7..2325a0222 100644 --- a/IHP/Test/Database.hs +++ b/IHP/Test/Database.hs @@ -25,7 +25,7 @@ data TestDatabase = TestDatabase -- createTestDatabase :: ByteString -> IO TestDatabase createTestDatabase databaseUrl = do - currentDir <- Directory.getCurrentDirectory +-- currentDir <- Directory.getCurrentDirectory databaseId <- UUID.nextRandom let databaseName = "test-" <> UUID.toText databaseId @@ -39,7 +39,7 @@ createTestDatabase databaseUrl = do libDir <- LibDir.findLibDirectory - let importSql file = Process.callCommand ("psql -h '" <> currentDir <> "/build/db' -d " <> (cs databaseName) <> " < " <> file) + let importSql file = Process.callCommand ("psql " <> (cs newUrl) <> " < " <> file) importSql (cs libDir <> "/IHPSchema.sql") importSql "Application/Schema.sql"