packages feed

persistent-test 2.13.0.1 → 2.13.0.2

raw patch · 4 files changed

+34/−2 lines, 4 files

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ ## Unreleased changes +## 2.13.0.2++* [#1275](https://github.com/yesodweb/persistent/pull/1275)+    * Add a test for SafeToRemove fields+ ## 2.13.0.1  * [#1265](https://github.com/yesodweb/persistent/pull/1265)
persistent-test.cabal view
@@ -1,5 +1,5 @@ name:            persistent-test-version:         2.13.0.1+version:         2.13.0.2 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>
src/PersistentTest.hs view
@@ -74,8 +74,27 @@ view :: s -> Getting a s t a b -> a view s l = getConstant (l Constant s) +safeToRemoveSpec :: forall backend m. Runner backend m => RunDb backend m -> Spec+safeToRemoveSpec runDb = do+    fdescribe "DudeWeirdColumns" $ do+        it "can insert and get" $ do+            let m = DudeWeirdColumns "hello" 50+            runDb $ do+                k <- insert m+                mval <- get k+                liftIO $ fmap dudeWeirdColumnsName mval `shouldBe` Just "hello"+        it "can putMany" $ do+            let ms =+                    [ DudeWeirdColumns "hello" 32+                    , DudeWeirdColumns "goodbyue" 60+                    ]+            runDb $ do+                putMany ms+                putMany ms+ specsWith :: forall backend m. Runner backend m => RunDb backend m -> Spec specsWith runDb = describe "persistent" $ do+  describe "SafeToRemove" (safeToRemoveSpec runDb)   it "fieldLens" $ do       let michael = Entity undefined $ Person "Michael" 28 Nothing :: Entity Person           michaelP1 = Person "Michael" 29 Nothing :: Person
src/PersistentTestModels.hs view
@@ -19,7 +19,7 @@ -- just need to ensure this compiles import PersistentTestModelsImports() -share [mkPersist persistSettings { mpsGeneric = True },  mkMigrate "testMigrate"] [persistUpperCase|+share [mkPersist persistSettings { mpsGeneric = True },  mkMigrate "testMigrate"] [persistLowerCase|  -- Dedented comment   -- Header-level comment@@ -97,6 +97,14 @@     !yes Int     ~no Int     def Int++  DudeWeirdColumns+    name Text+    age  Int+    -- foo  Int     Maybe MigrationOnly+    removedColumn  String  SafeToRemove+    UniqueName name+    deriving Eq Show    -- | This is a doc comment for a relationship.   -- | You need to put the pipe character for each line of documentation.