postgresql-simple-migration 0.1.14.0 → 0.1.15.0
raw patch · 4 files changed
+11/−6 lines, 4 filesdep ~base64-bytestringdep ~time
Dependency ranges changed: base64-bytestring, time
Files
- Changelog.markdown +3/−0
- Readme.markdown +1/−1
- postgresql-simple-migration.cabal +4/−3
- src/Database/PostgreSQL/Simple/Util.hs +3/−2
Changelog.markdown view
@@ -1,5 +1,8 @@ # Changelog +## 0.1.15.0+* Bumped dependencies+ ## 0.1.14.0 * Bumped dependencies
Readme.markdown view
@@ -19,7 +19,7 @@ ## Why? Database migrations should not be hard. They should be under version control-and documented in both your production systems and in your project files.+and documented both in your production systems and in your project files. ## What? This library executes SQL/Haskell migration scripts and keeps track of their
postgresql-simple-migration.cabal view
@@ -1,5 +1,5 @@ name: postgresql-simple-migration-version: 0.1.14.0+version: 0.1.15.0 synopsis: PostgreSQL Schema Migrations homepage: https://github.com/ameingast/postgresql-simple-migration Bug-reports: https://github.com/ameingast/postgresql-simple-migration/issues@@ -43,7 +43,7 @@ cryptohash >= 0.11 && < 0.12, directory >= 1.2 && < 1.4, postgresql-simple >= 0.4 && < 0.7,- time >= 1.4 && < 1.9+ time >= 1.4 && < 1.10 Executable migrate main-is: Main.hs@@ -57,12 +57,13 @@ cryptohash >= 0.11 && < 0.12, directory >= 1.2 && < 1.4, postgresql-simple >= 0.4 && < 0.7,- time >= 1.4 && < 1.9,+ time >= 1.4 && < 1.10, text >= 1.2 && < 1.3 test-suite tests main-is: Main.hs hs-source-dirs: test+ other-modules: Database.PostgreSQL.Simple.MigrationTest ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns default-extensions: OverloadedStrings, CPP, LambdaCase default-language: Haskell2010
src/Database/PostgreSQL/Simple/Util.hs view
@@ -21,15 +21,16 @@ import Control.Exception (finally) import Database.PostgreSQL.Simple (Connection, Only (..), begin, query, rollback)+import GHC.Int (Int64) -- | Checks if the table with the given name exists in the database. existsTable :: Connection -> String -> IO Bool existsTable con table =- fmap checkRowCount (query con q (Only table) :: IO [[Int]])+ fmap checkRowCount (query con q (Only table) :: IO [[Int64]]) where q = "select count(relname) from pg_class where relname = ?" - checkRowCount :: [[Int]] -> Bool+ checkRowCount :: [[Int64]] -> Bool checkRowCount ((1:_):_) = True checkRowCount _ = False