| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Database.Migrant.Run
Synopsis
- migrate :: Driver d => [MigrationName] -> (MigrationName -> d -> IO ()) -> (MigrationName -> d -> IO ()) -> d -> IO ()
- unsafeMigrate :: Driver d => [MigrationName] -> (MigrationName -> d -> IO ()) -> (MigrationName -> d -> IO ()) -> d -> IO ()
- executePlan :: Driver d => [(MigrationDirection, MigrationName)] -> (MigrationName -> d -> IO ()) -> (MigrationName -> d -> IO ()) -> d -> IO ()
- plan :: Driver d => [MigrationName] -> d -> IO [(MigrationDirection, MigrationName)]
- makePlan :: [MigrationName] -> [MigrationName] -> [(MigrationDirection, MigrationName)]
- data MigrationDirection
Documentation
Arguments
| :: Driver d | |
| => [MigrationName] | Target situation |
| -> (MigrationName -> d -> IO ()) | Factory for 'up' migration actions |
| -> (MigrationName -> d -> IO ()) | Factory for 'down' migration actions |
| -> d | |
| -> IO () |
Safely (transactionally) infer and execute a migration.
Arguments
| :: Driver d | |
| => [MigrationName] | Target situation |
| -> (MigrationName -> d -> IO ()) | Factory for 'up' migration actions |
| -> (MigrationName -> d -> IO ()) | Factory for 'down' migration actions |
| -> d | |
| -> IO () |
Infer and execute a migration in a non-transactional fashion. This means that migration failures may leave the database and migration tracking in an inconsistent state, so you should never call this outside of a transaction.
executePlan :: Driver d => [(MigrationDirection, MigrationName)] -> (MigrationName -> d -> IO ()) -> (MigrationName -> d -> IO ()) -> d -> IO () Source #
Apply a migration plan to a database. This should generally be done within the same transaction as loading the current situation from the database and creating a migration plan. Running this action outside of a transaction may leave the database and migration tracking in an inconsistent state.
plan :: Driver d => [MigrationName] -> d -> IO [(MigrationDirection, MigrationName)] Source #
Create a migration plan based on the current situation on the database, and the specified target.
Arguments
| :: [MigrationName] | target |
| -> [MigrationName] | current |
| -> [(MigrationDirection, MigrationName)] |
Make a plan from a previously loaded current situation and the specified target.
data MigrationDirection Source #
Constructors
| MigrateUp | |
| MigrateDown |