Build Status Coveralls GitHub tag Hex.pm

Erlang posrgresql migrations utils


Description

Project is based on epgpool and epgsql. It supports sql and erl migration description.

Usage

  1. Create migrations folder (for example, ./migrations)
  2. Create migration file with numeric prefix and .erl or .sql extension.
    The prefix must be unique monotonically increasing integer (1,2,3...).
    No dupplicates allowed!
  1. Run dbschema:up(MigrationDir) in you _app.erl start function.
  2. To downgrade call dbscheam:down(MigrationDir, PrefixNum)

Sql migration example

./migrations/1-init.sql

-- Up
create table test(
id serial primary key,
name text
);
-- Down
drop table test;