fix table parsing
This commit is contained in:
+5
-5
@@ -85,7 +85,7 @@ columns table = do
|
|||||||
return $ map ((addFK fks) . column) cols
|
return $ map ((addFK fks) . column) cols
|
||||||
|
|
||||||
where
|
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]
|
primaryKeyColumns :: QualifiedTable -> H.Tx H.Postgres s [Text]
|
||||||
@@ -135,14 +135,14 @@ data Column = Column {
|
|||||||
, colFK :: Maybe ForeignKey
|
, colFK :: Maybe ForeignKey
|
||||||
} deriving (Show)
|
} deriving (Show)
|
||||||
|
|
||||||
table :: (Text, Text, Bool) -> Table
|
table :: (Text, Text, Text) -> Table
|
||||||
table (s, n, i) = Table s n i
|
table (s, n, i) = Table s n (toBool i)
|
||||||
|
|
||||||
column :: (Text, Text, Text, Int, Text, Text, Text,
|
column :: (Text, Text, Text, Int, Text, Text, Text,
|
||||||
Maybe Int, Maybe Int, Maybe Text, Text)
|
Maybe Int, Maybe Int, Maybe Text, Text)
|
||||||
-> Column
|
-> Column
|
||||||
column (a, b, c, d, e, f, g, h, i, j, k) =
|
column (s, t, n, pos, nul, typ, u, l, p, d, e) =
|
||||||
Column a b c d (toBool e) f (toBool g) h i j (split (==',') k) Nothing
|
Column s t n pos (toBool nul) typ (toBool u) l p d (split (==',') e) Nothing
|
||||||
|
|
||||||
|
|
||||||
instance ToJSON Column where
|
instance ToJSON Column where
|
||||||
|
|||||||
Reference in New Issue
Block a user