diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # ChangeLog for yesod-persistent
 
+## 1.6.0.6
+
+* Add support for persistent 2.12
+
 ## 1.6.0.5
 
 * Add support for Persistent 2.11 [#1701](https://github.com/yesodweb/yesod/pull/1701)
diff --git a/Yesod/Persist/Core.hs b/Yesod/Persist/Core.hs
--- a/Yesod/Persist/Core.hs
+++ b/Yesod/Persist/Core.hs
@@ -196,7 +196,11 @@
     conflict <- checkUnique datum
     case conflict of
         Just unique ->
+#if MIN_VERSION_persistent(2, 12, 0)
+            badRequest' $ map (unFieldNameHS . fst) $ persistUniqueToFieldNames unique
+#else
             badRequest' $ map (unHaskellName . fst) $ persistUniqueToFieldNames unique
+#endif
         Nothing -> insert datum
 
 -- | Same as 'insert400', but doesn’t return a key.
diff --git a/yesod-persistent.cabal b/yesod-persistent.cabal
--- a/yesod-persistent.cabal
+++ b/yesod-persistent.cabal
@@ -1,6 +1,6 @@
 cabal-version:   >= 1.10
 name:            yesod-persistent
-version:         1.6.0.5
+version:         1.6.0.6
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -17,8 +17,8 @@
     default-language: Haskell2010
     build-depends:   base                      >= 4.10     && < 5
                    , yesod-core                >= 1.6      && < 1.7
-                   , persistent                >= 2.8      && < 2.12
-                   , persistent-template       >= 2.1      && < 2.10
+                   , persistent                >= 2.8
+                   , persistent-template       >= 2.1
                    , transformers              >= 0.2.2
                    , blaze-builder
                    , conduit
