persistent-0.2.3: Type-safe, non-relational, multi-backend persistence.



This is a helper module for creating SQL backends. Regular users do not need to use this module.



type Migration m = WriterT [String] (WriterT CautiousMigration m) ()Source

parseMigration :: Monad m => Migration m -> m (Either [String] CautiousMigration)Source

parseMigration' :: Monad m => Migration m -> m CautiousMigrationSource

runMigrationSilent :: MonadCatchIO m => Migration (SqlPersist m) -> SqlPersist m [String]Source

Same as runMigration, but returns a list of the SQL commands executed instead of printing them to stderr.

mkMigrate :: String -> [EntityDef] -> Q [Dec]Source

Creates a single function to perform all migrations for the entities defined here. One thing to be aware of is dependencies: if you have entities with foreign references, make sure to place those definitions after the entities they reference.