on dev help sign in
suppress notices in test
commit06b243891b21c6805b2cbe5f68f02d37ddf6b9e6 authorEitan Chatav <eitan.chatav@gmail.com> dateSat 24 Mar 2018, 17:09 (9 years ago) parent5369a78
1 file changed+11−3
squeal-postgresql/src/Squeal/PostgreSQL/Migration.hs+11−3
squeal-postgresql/src/Squeal/PostgreSQL/Migration.hs+11−3
@@ -76,15 +76,23 @@ let
7676 liftBase $ print num
7777:}
7878
79+>>> :{
80+let
81+ suppressNotices :: PQ schema schema IO ()
82+ suppressNotices = void . manipulate $ UnsafeManipulation
83+ "SET client_min_messages TO WARNING;"
84+:}
85+
7986>>> :{
8087withConnection "host=localhost port=5432 dbname=exampledb" $
81− migrateUp migrations
88+ suppressNotices
89+ & pqThen (migrateUp migrations)
8290 & pqThen numMigrations
8391 & pqThen (migrateDown migrations)
92+ & pqThen numMigrations
8493:}
85−NOTICE: relation "schema_migrations" already exists, skipping
8694Row 2
87−NOTICE: relation "schema_migrations" already exists, skipping
95+Row 0
8896-}
8997
9098{-# LANGUAGE