added non primary key fields to the entities used in the composite pk tests

This commit is contained in:
Alberto Valverde 2014-12-23 15:18:44 +01:00
parent 8c5511c623
commit 0dfbf270d6

View File

@ -63,11 +63,13 @@ share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistUpperCase|
deriving Eq Show deriving Eq Show
Frontcover Frontcover
number Int number Int
title String
Primary number Primary number
deriving Eq Show deriving Eq Show
Point Point
x Int x Int
y Int y Int
name String
Primary x y Primary x y
deriving Eq Show deriving Eq Show
|] |]
@ -922,7 +924,7 @@ main = do
it "works with custom primary key" $ it "works with custom primary key" $
run $ do run $ do
let fc = Frontcover number let fc = Frontcover number ""
number = 101 number = 101
Right thePk = keyFromValues [PersistInt64 $ fromIntegral number] Right thePk = keyFromValues [PersistInt64 $ fromIntegral number]
fcPk <- insert fc fcPk <- insert fc
@ -933,7 +935,7 @@ main = do
it "works with composite primary key" $ it "works with composite primary key" $
run $ do run $ do
let p = Point x y let p = Point x y ""
x = 10 x = 10
y = 15 y = 15
Right thePk = keyFromValues [ PersistInt64 $ fromIntegral x Right thePk = keyFromValues [ PersistInt64 $ fromIntegral x