create table on start
This commit is contained in:
parent
55ab85f927
commit
f6503a1707
2 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,7 @@ main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
conn <- connectPostgreSQL
|
conn <- connectPostgreSQL
|
||||||
"host='localhost' port=5432 dbname='mateamt' user='mateamt' password='mateamt'"
|
"host='localhost' port=5432 dbname='mateamt' user='mateamt' password='mateamt'"
|
||||||
|
execute_ conn initUser
|
||||||
run 3000 (app conn)
|
run 3000 (app conn)
|
||||||
|
|
||||||
app :: Connection -> Application
|
app :: Connection -> Application
|
||||||
|
|
|
@ -62,6 +62,9 @@ instance ToJSON UserSubmit where
|
||||||
|
|
||||||
instance FromJSON UserSubmit
|
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
|
userTable :: Table
|
||||||
( Maybe (Field SqlInt4)
|
( Maybe (Field SqlInt4)
|
||||||
, Field SqlText
|
, Field SqlText
|
||||||
|
|
Loading…
Reference in a new issue