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