An open API service indexing awesome lists of open source software.

https://github.com/swlkr/trek

Easy database migrations for clojure
https://github.com/swlkr/trek

clojure database migrations

Last synced: 10 months ago
JSON representation

Easy database migrations for clojure

Awesome Lists containing this project

README

          

# trek

Easy database migrations for clojure

## Usage

Migrations look like this

```sql
-- up
create table posts (
id serial primary key,
title text not null,
body text not null,
created_at timestamp
)

-- down
drop table posts
```

Migrations live in resources/migrations
There is no lein plugin but you could use aliases with
the functions below:

```clojure
(migrate db-spec) ; applies all pending migrations in order
(rollback db-spec) ; rolls one migration back
(create "create-users" "email:text" "password:text") ; creates a migration file in resources/migrations
```