Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Trying to get postgres scaffold work with latest persistent #211

Merged
merged 2 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ dependencies:
- yesod-core >=1.6 && <1.7
- yesod-auth >=1.6 && <1.7
- yesod-static >=1.6 && <1.7
- yesod-form >=1.6 && <1.7
- yesod-form >=1.6 && <1.8
- classy-prelude >=1.5 && <1.6
- classy-prelude-conduit >=1.5 && <1.6
- classy-prelude-yesod >=1.5 && <1.6
- bytestring >=0.10 && <0.11
- text >=0.11 && <2.0
- persistent >=2.9 && <2.11
- persistent-postgresql >=2.9 && <2.11
- persistent-template >=2.5 && <2.9
- persistent >=2.9 && <2.14
- persistent-postgresql >=2.13 && <2.14
- persistent-template >=2.5 && <2.14
- template-haskell
- shakespeare >=2.0 && <2.1
- hjsmin >=0.1 && <0.3
- monad-control >=0.3 && <1.1
- wai-extra >=3.0 && <3.1
- wai-extra >=3.0 && <3.2
- yaml >=0.11 && <0.12
- http-client-tls >=0.3 && <0.4
- http-conduit >=2.3 && <2.4
- directory >=1.1 && <1.4
- warp >=3.0 && <3.4
- data-default
- aeson >=1.4 && <1.5
- aeson >=1.4 && <2.1
- conduit >=1.0 && <2.0
- monad-logger >=0.3 && <0.4
- fast-logger >=2.2 && <3.1
- wai-logger >=2.2 && <2.4
- fast-logger >=2.2 && <3.2
- wai-logger >=2.2 && <2.5
- file-embed
- safe
- unordered-containers
Expand Down
7 changes: 4 additions & 3 deletions src/Model.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DataKinds #-}
module Model where

import ClassyPrelude.Yesod
Expand Down
5 changes: 3 additions & 2 deletions test/TestImport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module TestImport
import Application (makeFoundation, makeLogWare)
import ClassyPrelude as X hiding (delete, deleteBy, Handler)
import Database.Persist as X hiding (get)
import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool, rawExecute, rawSql, unSingle, connEscapeName)
import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool, rawExecute, rawSql, unSingle)
import Database.Persist.SqlBackend (getEscapedRawName)
import Foundation as X
import Model as X
import Test.Hspec as X
Expand Down Expand Up @@ -56,7 +57,7 @@ wipeDB app = runDBWithApp app $ do
-- Should your application grow to hundreds of tables and tests,
-- switching to DELETE could be a substantial speedup.
-- See: https://github.com/yesodweb/yesod-scaffold/issues/201
let escapedTables = map (connEscapeName sqlBackend . DBName) tables
let escapedTables = map (\t -> getEscapedRawName t sqlBackend) tables
query = "TRUNCATE TABLE " ++ intercalate ", " escapedTables
rawExecute query []

Expand Down