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)