persistent-postgresql 1.0.2 → 1.0.3
raw patch · 2 files changed
+7/−3 lines, 2 files
Files
Database/Persist/Postgresql.hs view
@@ -178,8 +178,9 @@ LibPQ.TuplesOk -> return () _ -> do msg <- LibPQ.resStatus status+ mmsg <- LibPQ.resultErrorMessage ret fail $ "Postgresql.withStmt': bad result status " ++- show status ++ " (" ++ show msg ++ ")"+ show status ++ " (" ++ (maybe (show msg) (show . (,) msg) mmsg) ++ ")" -- Get number and type of columns cols <- LibPQ.nfields ret@@ -373,7 +374,7 @@ getAltersU :: [(DBName, [DBName])] -> [(DBName, [DBName])] -> [AlterTable]- getAltersU [] old = map (DropConstraint . fst) old+ getAltersU [] old = map DropConstraint $ filter (not . isManual) $ map fst old getAltersU ((name, cols):news) old = case lookup name old of Nothing -> AddUniqueConstraint name cols : getAltersU news old@@ -384,6 +385,9 @@ else DropConstraint name : AddUniqueConstraint name cols : getAltersU news old'++ -- Don't drop constraints which were manually added.+ isManual (DBName x) = "__manual_" `T.isPrefixOf` x getColumn :: (Text -> IO Statement) -> DBName -> [PersistValue]
persistent-postgresql.cabal view
@@ -1,5 +1,5 @@ name: persistent-postgresql-version: 1.0.2+version: 1.0.3 license: MIT license-file: LICENSE author: Felipe Lessa, Michael Snoyman <michael@snoyman.com>