hpqtypes-extras 1.16.4.1 → 1.16.4.2
raw patch · 4 files changed
+12/−5 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- README.md +4/−1
- hpqtypes-extras.cabal +1/−1
- src/Database/PostgreSQL/PQTypes/Migrate.hs +4/−3
CHANGELOG.md view
@@ -1,3 +1,6 @@+# hpqtypes-extras-1.16.4.2 (2023-05-23)+* Make order of tables during schema creation irrelevant.+ # hpqtypes-extras-1.16.4.1 (2023-05-15) * Relax checks around indexes related to the `REINDEX` operation.
README.md view
@@ -1,4 +1,7 @@-# hpqtypes-extras [](https://hackage.haskell.org/package/hpqtypes-extras) [](http://travis-ci.org/scrive/hpqtypes-extras)+# hpqtypes-extras++[](https://github.com/scrive/hpqtypes-extras/actions?query=branch%3Amaster)+[](https://hackage.haskell.org/package/hpqtypes-extras) The following extras for [hpqtypes](http://hackage.haskell.org/package/hpqtypes) library:
hpqtypes-extras.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hpqtypes-extras-version: 1.16.4.1+version: 1.16.4.2 synopsis: Extra utilities for hpqtypes library description: The following extras for hpqtypes library: .
src/Database/PostgreSQL/PQTypes/Migrate.hs view
@@ -25,6 +25,8 @@ -- Create empty table and add the columns. runQuery_ $ sqlCreateTable tblName runQuery_ $ sqlAlterTable tblName $ map sqlAddColumn tblColumns+ -- Add the primary key if applicable.+ forM_ tblPrimaryKey $ \pk -> runQuery_ $ sqlAlterTable tblName [sqlAddPK tblName pk] -- Add indexes. forM_ tblIndexes $ runQuery_ . sqlCreateIndexMaybeDowntime tblName -- Add all the other constraints if applicable.@@ -40,9 +42,8 @@ createTableConstraints Table{..} = when (not $ null addConstraints) $ do runQuery_ $ sqlAlterTable tblName addConstraints where- addConstraints = concat [- [sqlAddPK tblName pk | Just pk <- return tblPrimaryKey]- , map sqlAddValidCheckMaybeDowntime tblChecks+ addConstraints = concat+ [ map sqlAddValidCheckMaybeDowntime tblChecks , map (sqlAddValidFKMaybeDowntime tblName) tblForeignKeys ]