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 Uni_CDBI
import Database.CDBI.ER import Database.CDBI.ER
import Database.CDBI.Connection import Database.CDBI.Connection
...@@ -5,18 +7,17 @@ import Time ...@@ -5,18 +7,17 @@ import Time
createTestData :: IO () createTestData :: IO ()
createTestData = do createTestData = do
conn <- connectSQLite sqliteDBFile result <- runWithDB sqliteDBFile $
result <- ((insertEntries studentList student_CDBI_Description) >+ insertEntries student_CDBI_Description studentList >+
(insertEntries lectureList lecture_CDBI_Description) >+ insertEntries lecturer_CDBI_Description lecturerList >+
(insertEntries lecturerList lecturer_CDBI_Description) >+ insertEntries lecture_CDBI_Description lectureList >+
(insertEntries placeList place_CDBI_Description) >+ insertEntries place_CDBI_Description placeList >+
(insertEntries timeList time_CDBI_Description) >+ insertEntries time_CDBI_Description timeList >+
(insertEntries examList exam_CDBI_Description) >+ insertEntries exam_CDBI_Description examList >+
(insertEntries resultList result_CDBI_Description) >+ insertEntries result_CDBI_Description resultList >+
(insertEntries participList participation_CDBI_Description) >+ insertEntryCombined sseDescription sse1 >+
(insertEntryCombined sse1 sseDescription) insertEntries participation_CDBI_Description participList >+
) conn setForeignKeyCheck True
disconnect conn
case result of case result of
Left (DBError kind str) -> putStrLn ((show kind) ++ " " ++ str) Left (DBError kind str) -> putStrLn ((show kind) ++ " " ++ str)
Right _ -> putStrLn "Ok" 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