From 0dfbf270d6ee39c0ac84c5587851e2ea37b58eb6 Mon Sep 17 00:00:00 2001 From: Alberto Valverde Date: Tue, 23 Dec 2014 15:18:44 +0100 Subject: [PATCH] added non primary key fields to the entities used in the composite pk tests --- test/Test.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Test.hs b/test/Test.hs index b362b7b..3356554 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -63,11 +63,13 @@ share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistUpperCase| deriving Eq Show Frontcover number Int + title String Primary number deriving Eq Show Point x Int y Int + name String Primary x y deriving Eq Show |] @@ -922,7 +924,7 @@ main = do it "works with custom primary key" $ run $ do - let fc = Frontcover number + let fc = Frontcover number "" number = 101 Right thePk = keyFromValues [PersistInt64 $ fromIntegral number] fcPk <- insert fc @@ -933,7 +935,7 @@ main = do it "works with composite primary key" $ run $ do - let p = Point x y + let p = Point x y "" x = 10 y = 15 Right thePk = keyFromValues [ PersistInt64 $ fromIntegral x