Skip to content

Commit

Permalink
Database url not relative to current dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
Montmorency committed Oct 9, 2023
1 parent 5060e9e commit a4f567a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IHP/Test/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit a4f567a

Please sign in to comment.