<jack>

If it’s too hard you’re doing it wrong.

Tern 1.0.0 Released

Posted at — Apr 19, 2014

Tern is a standalone database migration tool for PostgreSQL. Formerly written in Ruby, the initial version 1 release is entirely rewritten in Go. It now is a single binary with zero dependencies on Ruby gems or bundler. The workflow has also been simplified.

Here are a few sample migrations:

-- 001_create_t1.sql

create table t1(
  id serial primary key
);

---- create above / drop below ----

drop table t1;
-- 002_create_t2.sql

create table t2(
  id serial primary key
);

---- create above / drop below ----

drop table t2;

This is an irreversible migration:

-- 003_irreversible.sql

drop table t2;

Here is the config file for an example project:

{
  "host": "127.0.0.1",
  "database": "tern_test",
  "user": "jack",
  "password": "secret"
}

Check it out at Github.