migrant-core-0.1.0.2: Semi-automatic database schema migrations
Safe HaskellNone
LanguageHaskell2010

Database.Migrant.Run

Synopsis

Documentation

migrate Source #

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.

unsafeMigrate Source #

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.

makePlan Source #

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 

Instances

Instances details
Bounded MigrationDirection Source # 
Instance details

Defined in Database.Migrant.Run

Enum MigrationDirection Source # 
Instance details

Defined in Database.Migrant.Run

Eq MigrationDirection Source # 
Instance details

Defined in Database.Migrant.Run

Ord MigrationDirection Source # 
Instance details

Defined in Database.Migrant.Run

Show MigrationDirection Source # 
Instance details

Defined in Database.Migrant.Run