hasql-migration-0.1.0: PostgreSQL Schema Migrations

Copyright(c) 2016 Timo von Holtz <tvh@tvholtz.de>
(c) 2014 Andreas Meingast <ameingast@gmail.com>
LicenseBSD-style
Maintainertvh@tvholtz.de
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Hasql.Migration

Contents

Description

A migration library for hasql.

Synopsis

Migration actions

runMigration :: MigrationCommand -> Transaction (MigrationResult String) Source #

Executes a MigrationCommand.

Returns MigrationSuccess if the provided MigrationCommand executes without error. If an error occurs, execution is stopped and a MigrationError is returned.

loadMigrationFromFile :: ScriptName -> FilePath -> IO MigrationCommand Source #

load a migration from script located at the provided FilePath.

loadMigrationsFromDirectory :: FilePath -> IO [MigrationCommand] Source #

Load migrations from SQL scripts in the provided FilePath in alphabetical order.

Migration types

type ScriptName = String Source #

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

type Checksum = Text Source #

The checksum type of a migration script.

Migration result actions

getMigrations :: Transaction [SchemaMigration] Source #

Produces a list of all executed SchemaMigrations.

Migration result types