create table on start

This commit is contained in:
nek0 2019-04-16 13:03:07 +02:00
parent 55ab85f927
commit f6503a1707
2 changed files with 4 additions and 0 deletions

View file

@ -26,6 +26,7 @@ main :: IO ()
main = do
conn <- connectPostgreSQL
"host='localhost' port=5432 dbname='mateamt' user='mateamt' password='mateamt'"
execute_ conn initUser
run 3000 (app conn)
app :: Connection -> Application

View file

@ -62,6 +62,9 @@ instance ToJSON UserSubmit where
instance FromJSON UserSubmit
initUser :: PGS.Query
initUser = "create table if not exists \"user\" (id serial, ident varchar(128) not null, balance integer not null, time_stamp date not null, email varchar(128), avatar integer, pin varchar(128))"
userTable :: Table
( Maybe (Field SqlInt4)
, Field SqlText