Commit c6980e16 authored by Michael Hanus 's avatar Michael Hanus
Browse files

DB test data generation corrected

parent a7fc20e0
{-# OPTIONS_CYMAKE -Wno-missing-signatures #-}
import Uni_CDBI
import Database.CDBI.ER
import Database.CDBI.Connection
......@@ -5,18 +7,17 @@ import Time
createTestData :: IO ()
createTestData = do
conn <- connectSQLite sqliteDBFile
result <- ((insertEntries studentList student_CDBI_Description) >+
(insertEntries lectureList lecture_CDBI_Description) >+
(insertEntries lecturerList lecturer_CDBI_Description) >+
(insertEntries placeList place_CDBI_Description) >+
(insertEntries timeList time_CDBI_Description) >+
(insertEntries examList exam_CDBI_Description) >+
(insertEntries resultList result_CDBI_Description) >+
(insertEntries participList participation_CDBI_Description) >+
(insertEntryCombined sse1 sseDescription)
) conn
disconnect conn
result <- runWithDB sqliteDBFile $
insertEntries student_CDBI_Description studentList >+
insertEntries lecturer_CDBI_Description lecturerList >+
insertEntries lecture_CDBI_Description lectureList >+
insertEntries place_CDBI_Description placeList >+
insertEntries time_CDBI_Description timeList >+
insertEntries exam_CDBI_Description examList >+
insertEntries result_CDBI_Description resultList >+
insertEntryCombined sseDescription sse1 >+
insertEntries participation_CDBI_Description participList >+
setForeignKeyCheck True
case result of
Left (DBError kind str) -> putStrLn ((show kind) ++ " " ++ str)
Right _ -> putStrLn "Ok"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment