From 3151aa2ebcc564b65a384edcde38debab29c26c1 Mon Sep 17 00:00:00 2001 From: "Adam C. Baker" Date: Mon, 26 Jan 2015 18:42:46 -0800 Subject: [PATCH] fix table parsing --- src/PgStructure.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PgStructure.hs b/src/PgStructure.hs index de6fff76c..11b8c9154 100644 --- a/src/PgStructure.hs +++ b/src/PgStructure.hs @@ -85,7 +85,7 @@ columns table = do return $ map ((addFK fks) . column) cols where - addFK fks = (\col -> col { colFK = Map.lookup (cs . colName $ col) fks }) + addFK fks col = col { colFK = Map.lookup (cs . colName $ col) fks } primaryKeyColumns :: QualifiedTable -> H.Tx H.Postgres s [Text] @@ -135,14 +135,14 @@ data Column = Column { , colFK :: Maybe ForeignKey } deriving (Show) -table :: (Text, Text, Bool) -> Table -table (s, n, i) = Table s n i +table :: (Text, Text, Text) -> Table +table (s, n, i) = Table s n (toBool i) column :: (Text, Text, Text, Int, Text, Text, Text, Maybe Int, Maybe Int, Maybe Text, Text) -> Column -column (a, b, c, d, e, f, g, h, i, j, k) = - Column a b c d (toBool e) f (toBool g) h i j (split (==',') k) Nothing +column (s, t, n, pos, nul, typ, u, l, p, d, e) = + Column s t n pos (toBool nul) typ (toBool u) l p d (split (==',') e) Nothing instance ToJSON Column where