Haskell Persistent Database Primary Key

Viewed 543

When using the following code, I don't want to use the default database key. Intead, I plan to generate a hashcode from a piece of information and use it as a key. How should I use such a key?

share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
Person
    name String
    age Int Maybe
    deriving Show
BlogPost
    title String
    authorId PersonId
    deriving Show
|]
1 Answers
Related