mod package:hledger-web

integer modulus, satisfying
(x `div` y)*y + (x `mod` y) == x
WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.
simultaneous div and mod WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.
The basic function for migrating models, no Template Haskell required. It's probably best to use this in concert with mkEntityDefList, and then call migrateModels with the result from that function.
share [mkPersist sqlSettings, mkEntityDefList "entities"] [persistLowerCase| ... |]

migrateAll = migrateModels entities
The function mkMigrate currently implements exactly this behavior now. If you're splitting up the entity definitions into separate files, then it is better to use the entity definition list and the concatenate all the models together into a big list to call with migrateModels.
module Foo where

share [mkPersist s, mkEntityDefList "fooModels"] ...


module Bar where

share [mkPersist s, mkEntityDefList "barModels"] ...

module Migration where

import Foo
import Bar

migrateAll = migrateModels (fooModels <> barModels)
Send a 304 not modified response immediately. This is a short-circuiting action.