PersistTestPetCollarType.hs 371 B

12345678910111213141516
  1. {-# LANGUAGE DeriveGeneric #-}
  2. {-# LANGUAGE TemplateHaskell #-}
  3. module PersistTestPetCollarType where
  4. import GHC.Generics
  5. import Data.Aeson
  6. import Database.Persist.TH
  7. import Data.Text (Text)
  8. data PetCollar = PetCollar {tag :: Text, bell :: Bool}
  9. deriving (Generic, Eq, Show)
  10. instance ToJSON PetCollar
  11. instance FromJSON PetCollar
  12. derivePersistFieldJSON "PetCollar"