Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 121f9d7

Browse files
committedOct 12, 2019
getMigrations should also have a getMigrations'
1 parent 9a440d4 commit 121f9d7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎src/Database/PostgreSQL/Simple/Migration.hs

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module Database.PostgreSQL.Simple.Migration
3737

3838
-- * Migration result actions
3939
, getMigrations
40+
, getMigrations'
4041

4142
-- * Migration result types
4243
, SchemaMigration(..)
@@ -337,10 +338,14 @@ data MigrationContext' = MigrationContext'
337338
, migrationTableName :: !BS.ByteString
338339
-- ^ The name of the table that stores the migrations
339340
}
341+
--
342+
-- | Produces a list of all executed 'SchemaMigration's.
343+
getMigrations :: Connection -> IO [SchemaMigration]
344+
getMigrations con = getMigrations' con "schema_migrations"
340345

341346
-- | Produces a list of all executed 'SchemaMigration's.
342-
getMigrations :: Connection -> BS.ByteString -> IO [SchemaMigration]
343-
getMigrations con tableName = query_ con q
347+
getMigrations' :: Connection -> BS.ByteString -> IO [SchemaMigration]
348+
getMigrations' con tableName = query_ con q
344349
where q = mconcat
345350
[ "select filename, checksum, executed_at "
346351
, "from " <> Query tableName <> " order by executed_at asc"

0 commit comments

Comments
 (0)