postgresql-orm-0.5.0: An ORM (Object Relational Mapping) and migrations DSL for PostgreSQL.

Database.PostgreSQL.Migrate

Description

Functions for creating and running database migrations. You should probably be using the pg_migrate executable to run migrations, however these functions are exposed for developers that want to integrate migrations more tightly into their applications or utilities.

Synopsis

# Documentation

Initializes the database by creating a "schema-migrations" table. This table must exist before running any migrations.

Arguments

 :: Handle Log output (probably stdout) -> FilePath Path to directory containing migrations -> IO ExitCode

Runs all new migrations in a given directory and dumps the resulting schema to a file "schema.sql" in the migrations directory.

Determining which migrations to run is done by querying the database for the largest version in the schema_migrations table, and choosing all migrations in the given directory with higher versions.

Dumps the database schema to the given file handle.

This is a wrapper around the utility pg_dump that comes with postgresql. Therefore, pg_dump must be installed on the system.

The default relative path containing migrations: "db/migrations"

Constructors

 MigrationDetails Fields

Instances

 Source # MethodsshowList :: [MigrationDetails] -> ShowS #