Skip to content

Commit

Permalink
* Make use of CautiousMigration type alias in SQL backends. (#1459)
Browse files Browse the repository at this point in the history
* Bump persistent-mysql, persistent-postgresql and persistent-sqlite versions.

* Update respective changelogs.
  • Loading branch information
arrowd authored Jan 22, 2023
1 parent bea2018 commit 6fdbf84
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 7 deletions.
5 changes: 5 additions & 0 deletions persistent-mysql/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog for persistent-mysql

## 2.13.1.4

* [#1459](https://github.com/yesodweb/persistent/pull/1459)
* Make use of `CautiousMigration` type alias for clarity.

## 2.13.1.3

* [#1372](https://github.com/yesodweb/persistent/pull/1372)
Expand Down
2 changes: 1 addition & 1 deletion persistent-mysql/Database/Persist/MySQL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ migrate' :: MySQL.ConnectInfo
-> [EntityDef]
-> (Text -> IO Statement)
-> EntityDef
-> IO (Either [Text] [(Bool, Text)])
-> IO (Either [Text] CautiousMigration)
migrate' connectInfo allDefs getter val = do
let name = getEntityDBName val
let (newcols, udefs, fdefs) = mysqlMkColumns allDefs val
Expand Down
2 changes: 1 addition & 1 deletion persistent-mysql/persistent-mysql.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: persistent-mysql
version: 2.13.1.3
version: 2.13.1.4
license: MIT
license-file: LICENSE
author: Felipe Lessa <[email protected]>, Michael Snoyman
Expand Down
5 changes: 5 additions & 0 deletions persistent-postgresql/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog for persistent-postgresql

## 2.13.5.1

* [#1459](https://github.com/yesodweb/persistent/pull/1459)
* Make use of `CautiousMigration` type alias for clarity.

## 2.13.5.0

* [#1362](https://github.com/yesodweb/persistent/pull/1362/)
Expand Down
2 changes: 1 addition & 1 deletion persistent-postgresql/Database/Persist/Postgresql.hs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ doesTableExist getter (EntityNameDB name) = do
migrate' :: [EntityDef]
-> (Text -> IO Statement)
-> EntityDef
-> IO (Either [Text] [(Bool, Text)])
-> IO (Either [Text] CautiousMigration)
migrate' allDefs getter entity = fmap (fmap $ map showAlterDb) $ do
old <- getColumns getter entity newcols'
case partitionEithers old of
Expand Down
2 changes: 1 addition & 1 deletion persistent-postgresql/persistent-postgresql.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: persistent-postgresql
version: 2.13.5.0
version: 2.13.5.1
license: MIT
license-file: LICENSE
author: Felipe Lessa, Michael Snoyman <[email protected]>
Expand Down
5 changes: 5 additions & 0 deletions persistent-sqlite/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog for persistent-sqlite

## 2.13.1.1

* [#1459](https://github.com/yesodweb/persistent/pull/1459)
* Make use of `CautiousMigration` type alias for clarity.

## 2.13.1.0

* [#1341](https://github.com/yesodweb/persistent/pull/1341)
Expand Down
3 changes: 1 addition & 2 deletions persistent-sqlite/Database/Persist/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ import qualified Database.Persist.Sql.Util as Util
import Database.Persist.SqlBackend
import qualified Database.Sqlite as Sqlite


-- | Create a pool of SQLite connections.
--
-- Note that this should not be used with the @:memory:@ connection string, as
Expand Down Expand Up @@ -442,7 +441,7 @@ migrate'
:: [EntityDef]
-> (Text -> IO Statement)
-> EntityDef
-> IO (Either [Text] [(Bool, Text)])
-> IO (Either [Text] CautiousMigration)
migrate' allDefs getter val = do
let (cols, uniqs, fdefs) = sqliteMkColumns allDefs val
let newSql = mkCreateTable False def (filter (not . safeToRemove val . cName) cols, uniqs, fdefs)
Expand Down
2 changes: 1 addition & 1 deletion persistent-sqlite/persistent-sqlite.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: persistent-sqlite
version: 2.13.1.0
version: 2.13.1.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <[email protected]>
Expand Down

0 comments on commit 6fdbf84

Please sign in to comment.