Using mkMigrate in scaffolding
This commit is contained in:
parent
d3a9201b27
commit
f0ba72d536
@ -243,7 +243,7 @@ mkToForm =
|
||||
let x = foldl (ap' ap) just' $ map (go' ffs' stm string') a
|
||||
in ftt `AppE` x
|
||||
go' ffs' stm string' (((theId, name), ((label, tooltip), tff)), ex) =
|
||||
let label' = string' `AppE` LitE (StringL label)
|
||||
let label' = LitE $ StringL label
|
||||
tooltip' = string' `AppE` LitE (StringL tooltip)
|
||||
ffs = ffs' `AppE`
|
||||
label' `AppE`
|
||||
|
||||
@ -13,6 +13,7 @@ module Yesod.Form.Jquery
|
||||
, jqueryDayFieldProfile
|
||||
, googleHostedJqueryUiCss
|
||||
, JqueryDaySettings (..)
|
||||
, Default (..)
|
||||
) where
|
||||
|
||||
import Yesod.Handler
|
||||
|
||||
@ -32,9 +32,7 @@ getRobotsR = return $ RepPlain $ toContent "User-agent: *"
|
||||
-- migrations handled by Yesod.
|
||||
with~sitearg~ :: (Application -> IO a) -> IO a
|
||||
with~sitearg~ f = Settings.withConnectionPool $ \p -> do
|
||||
flip runConnectionPool p $ runMigration $ do
|
||||
migrate (undefined :: User)
|
||||
migrate (undefined :: Email)
|
||||
runConnectionPool (runMigration migrateAll) p
|
||||
let h = ~sitearg~ s p
|
||||
toWaiApp h >>= f
|
||||
where
|
||||
|
||||
@ -2,11 +2,13 @@
|
||||
module Model where
|
||||
|
||||
import Yesod
|
||||
import Database.Persist.TH (share2)
|
||||
import Database.Persist.GenericSql (mkMigrate)
|
||||
|
||||
-- You can define all of your database entities here. You can find more
|
||||
-- information on persistent and how to declare entities at:
|
||||
-- http://docs.yesodweb.com/book/persistent/
|
||||
mkPersist [$persist|
|
||||
share2 mkPersist (mkMigrate "migrateAll") [$persist|
|
||||
User
|
||||
ident String
|
||||
password String null update
|
||||
|
||||
Loading…
Reference in New Issue
Block a user