diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,5 @@
+1.0.5
+* bump persistent to 2.10
 1.0.4
 * Default auth id to NULL to fix a MySQL bug.
 1.0.3
diff --git a/serversession-backend-persistent.cabal b/serversession-backend-persistent.cabal
--- a/serversession-backend-persistent.cabal
+++ b/serversession-backend-persistent.cabal
@@ -1,5 +1,6 @@
+cabal-version:   >= 1.10
 name:            serversession-backend-persistent
-version:         1.0.4
+version:         1.0.5
 license:         MIT
 license-file:    LICENSE
 author:          Felipe Lessa <felipe.lessa@gmail.com>
@@ -7,7 +8,6 @@
 synopsis:        Storage backend for serversession using persistent and an RDBMS.
 category:        Web
 stability:       Stable
-cabal-version:   >= 1.8
 build-type:      Simple
 homepage:        https://github.com/yesodweb/serversession
 description:     API docs and the README are available at <http://www.stackage.org/package/serversession-backend-persistent>
@@ -19,6 +19,7 @@
   manual: True
 
 library
+  default-language: Haskell2010
   hs-source-dirs: src
   build-depends:
       base                      == 4.*
@@ -27,7 +28,7 @@
     , bytestring
     , cereal                    >= 0.4
     , path-pieces
-    , persistent                >= 2.1
+    , persistent                >= 2.10
     , tagged                    >= 0.7
     , text
     , time
@@ -39,7 +40,7 @@
     Web.ServerSession.Backend.Persistent
     Web.ServerSession.Backend.Persistent.Internal.Impl
     Web.ServerSession.Backend.Persistent.Internal.Types
-  extensions:
+  default-extensions:
     DeriveDataTypeable
     EmptyDataDecls
     FlexibleContexts
@@ -62,6 +63,7 @@
 
 
 test-suite tests
+  default-language: Haskell2010
   type: exitcode-stdio-1.0
   hs-source-dirs:  tests
   build-depends:
@@ -79,11 +81,11 @@
 
     , serversession
     , serversession-backend-persistent
-  extensions:
+  default-extensions:
     OverloadedStrings
     TemplateHaskell
   main-is:         Main.hs
-  ghc-options:     -Wall -threaded "-with-rtsopts=-N -s -M1G -c" -rtsopts
+  ghc-options:     -Wall -threaded "-with-rtsopts=-N -s -M2G -c" -rtsopts
   if flag(lib-Werror)
     ghc-options: -Werror
 
diff --git a/src/Web/ServerSession/Backend/Persistent/Internal/Impl.hs b/src/Web/ServerSession/Backend/Persistent/Internal/Impl.hs
--- a/src/Web/ServerSession/Backend/Persistent/Internal/Impl.hs
+++ b/src/Web/ServerSession/Backend/Persistent/Internal/Impl.hs
@@ -96,6 +96,7 @@
         ["Eq", "Ord", "Show", "Typeable"]
         M.mempty
         False
+        Nothing
     where
       pfd :: P.EntityField (PersistentSession sess) typ -> P.FieldDef
       pfd = P.persistFieldDef
@@ -142,8 +143,10 @@
                  (P.SqlOther "SqlType unset for key")
                  []
                  True
-                 P.NoReference]
+                 P.NoReference
+                 Nothing]
               []))
+        Nothing
   persistFieldDef PersistentSessionKey
     = P.FieldDef
         (P.HaskellName "key")
@@ -153,6 +156,7 @@
         ["maxlen=30"]
         True
         P.NoReference
+        Nothing
   persistFieldDef PersistentSessionAuthId
     = P.FieldDef
         (P.HaskellName "authId")
@@ -162,6 +166,7 @@
         ["Maybe", "default=NULL"]
         True
         P.NoReference
+        Nothing
   persistFieldDef PersistentSessionSession
     = P.FieldDef
         (P.HaskellName "session")
@@ -171,6 +176,7 @@
         []
         True
         P.NoReference
+        Nothing
   persistFieldDef PersistentSessionCreatedAt
     = P.FieldDef
         (P.HaskellName "createdAt")
@@ -180,6 +186,7 @@
         []
         True
         P.NoReference
+        Nothing
   persistFieldDef PersistentSessionAccessedAt
     = P.FieldDef
         (P.HaskellName "accessedAt")
@@ -189,6 +196,7 @@
         []
         True
         P.NoReference
+        Nothing
 
   persistIdField = PersistentSessionId
 
