postgresql-simple-migration-0.1.0.0: PostgreSQL Schema Migrations

Copyright(c) 2014 Andreas Meingast <ameingast@gmail.com>
LicenseBSD-style
Maintainerameingast@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Simple.Migration

Description

Migration library for postgresql-simple.

Synopsis

Documentation

runMigration :: MigrationContext -> IO (MigrationResult String) Source

Executes migrations inside the provided MigrationContext.

data MigrationContext Source

The MigrationContext provides an execution context for migrations.

Constructors

MigrationContext 

Fields

migrationContextCommand :: MigrationCommand

The action that will be performed by runMigration

migrationContextVerbose :: Bool

Verbosity of the library.

migrationContextConnection :: Connection

The PostgreSQL connection to use for migrations.

data MigrationCommand Source

MigrationCommand determines the action of the runMigration script.

Constructors

MigrationInitialization

Initializes the database with a helper table containing meta information.

MigrationDirectory FilePath

Executes migrations based on SQL scripts in the provided FilePath in alphabetical order.

MigrationFile ScriptName FilePath

Executes a migration based on script located at the provided FilePath.

MigrationScript ScriptName ByteString

Executes a migration based on the provided bytestring.

data MigrationResult a Source

A sum-type denoting the result of a migration.

Constructors

MigrationError a

There was an error in script migration.

MigrationSuccess

All scripts have been executed successfully.

Instances

type ScriptName = String Source

The name of a script. Typically the filename or a custom name when using Haskell migrations.